From 2563164e089f0f11a0b40bd4a7c59c63c7d50200 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Fri, 16 Aug 2024 20:25:11 +0200 Subject: [PATCH] Reduce default query result cache threshold to 50 --- INSTALLATION.md | 2 +- functions.php | 2 +- includes/functions/settings/_settings_page_general.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index bab479b4..2061d0e0 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -1600,7 +1600,7 @@ define( 'CONSTANT_NAME', value ); | FICTIONEER_CARD_CACHE_LIMIT | integer | Number of story cards cached if the feature is enabled. Default `50`. | FICTIONEER_CARD_CACHE_EXPIRATION_TIME | integer | Time until the whole story card cache expires in seconds. Default `HOUR_IN_SECONDS`. | FICTIONEER_STORY_CARD_CHAPTER_LIMIT | integer | Maximum number of chapters shown on story cards. Default 3. -| FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD | integer | Count of a query result required to be eligible for caching. Default `75`. +| FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD | integer | Count of a query result required to be eligible for caching. Default `50`. | FICTIONEER_QUERY_RESULT_CACHE_LIMIT | integer | Number of query results cached if the feature is enabled. Default `50`. | FICTIONEER_QUERY_RESULT_CACHE_BREAK | integer | Limit the number of large query result cache uploads per request. Default `3`. | FICTIONEER_CACHE_PURGE_ASSIST | boolean | Whether to call the cache purge assist function on post updates. Default `true`. diff --git a/functions.php b/functions.php index 31245936..163a0a46 100644 --- a/functions.php +++ b/functions.php @@ -305,7 +305,7 @@ if ( ! defined( 'FICTIONEER_STORY_CARD_CHAPTER_LIMIT' ) ) { // Integer: Count of the query results required to be eligible for caching if ( ! defined( 'FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD' ) ) { - define( 'FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD', 75 ); + define( 'FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD', 50 ); } // Integer: Maximum query results cached as Transients diff --git a/includes/functions/settings/_settings_page_general.php b/includes/functions/settings/_settings_page_general.php index 35769309..9d7c7959 100644 --- a/includes/functions/settings/_settings_page_general.php +++ b/includes/functions/settings/_settings_page_general.php @@ -758,7 +758,7 @@ FICTIONEER_QUERY_RESULT_CACHE_LIMIT, FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD ), - __( '

Queries that return many results are resource-intensive and can slow down your site, especially for stories with hundreds of chapters. This feature mitigates the slowdown by caching the results of the largest queries in the database, typically resulting in faster loading times.

You can use the FICTIONEER_QUERY_RESULT_CACHE_LIMIT constant to change the number of cached results (default is 50) and the FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD constant to change what constitutes as large result (default is 75). Be aware that increasing these numbers will result in higher RAM consumption.

', 'fictioneer' ) + __( '

Queries that return many results are resource-intensive and can slow down your site, especially for stories with hundreds of chapters. This feature mitigates the slowdown by caching the results of the largest queries in the database, typically resulting in faster loading times.

You can use the FICTIONEER_QUERY_RESULT_CACHE_LIMIT constant to change the number of cached results (default is 50) and the FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD constant to change what constitutes as large result (default is 50). Be aware that increasing these numbers will result in higher RAM consumption.

', 'fictioneer' ) ); ?>