Automattic / Automattic/VIP-Coding-Standards

Enhance logic of LowCacheTime to minimize noise.

オープン
#408 コメント 1 件 リアクション 1 件 担当者 1 名 @rebeccahum が担当を希望しています GitHub で見る
Status: Has PR Type: Enhancement
主要言語
PHP
スター
261
フォーク
44
平均マージ
19分
マージ済み PR(30日)
1

説明

`❗️ 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?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。