Automattic / Automattic/VIP-Coding-Standards

Enhance logic of LowCacheTime to minimize noise.

Abierto
#408 1 comentario 1 reacción 1 asignado Reclamado por @rebeccahum Ver en GitHub
Status: Has PR Type: Enhancement
Lenguaje dominante
PHP
Estrellas
261
Forks
44
Merge medio
19 min
PR fusionados (30 d)
1

Descripción

`❗️ Warning: Low cache expiry time of "wp_rand( 5 * MINUTE_IN_SECONDS, 10 * MINUTE_IN_SECONDS )", it is recommended to have 300 seconds or more (WordPressVIPMinimum.Cache.LowExpiryCacheTime.LowCacheTime).`

`wp_cache_set( $latest_blocks_cache_key, $latest_blocks, null, wp_rand( 5 * MINUTE_IN_SECONDS, 10 * MINUTE_IN_SECONDS ) );`

## What problem would the enhancement address for VIP?
It is very common for clients to use constants HOUR_IN_SECONDS, DAY_IN_SECONDS, MINUTE_IN_SECONDS and to also vary the duration to not have cache stampedes.

## Describe the solution you'd like
Can we enhance the logic of the ruleset to not flag for common usages?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.