-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the cache regeneration behavior with refreshMode = 0? #755
Comments
This is not the expected behaviour when the refresh mode is set to |
When a entry is created or saved, the cache is regenerated for some elements. Application Info
Installed Plugins
Loaded Modules
Blitz Plugin Settings{
"debug": false,
"hintsEnabled": true,
"cachingEnabled": true,
"refreshCacheEnabled": true,
"refreshMode": 0,
"includedUriPatterns": [
{
"siteId": "",
"uriPattern": "inventaire",
"enabled": true
},
{
"siteId": "",
"uriPattern": "area",
"enabled": true
}
],
"excludedUriPatterns": [],
"cacheStorageType": "putyourlightson\\blitz\\drivers\\storage\\FileStorage",
"cacheStorageSettings": {
"folderPath": "@webroot\/cache\/blitz",
"compressCachedValues": ""
},
"cacheStorageTypes": [],
"cacheGeneratorType": "putyourlightson\\blitz\\drivers\\generators\\HttpGenerator",
"cacheGeneratorSettings": {
"concurrency": "3"
},
"cacheGeneratorTypes": [],
"customSiteUris": [],
"cachePurgerType": "putyourlightson\\blitz\\drivers\\purgers\\DummyPurger",
"cachePurgerSettings": [],
"cachePurgerTypes": [],
"deployerType": "putyourlightson\\blitz\\drivers\\deployers\\DummyDeployer",
"deployerSettings": [],
"deployerTypes": [],
"ssiEnabled": false,
"ssiTagFormat": "<!--#include virtual=\"{uri}\" -->",
"detectSsiEnabled": true,
"esiEnabled": false,
"onlyCacheLowercaseUris": false,
"queryStringCaching": 1,
"includedQueryStringParams": [
{
"enabled": "1",
"queryStringParam": ".*"
}
],
"excludedQueryStringParams": [
{
"enabled": "1",
"queryStringParam": "gclid"
},
{
"enabled": "1",
"queryStringParam": "fbclid"
}
],
"apiKey": "",
"generatePagesWithQueryStringParams": false,
"purgeAssetImagesWhenChanged": true,
"refreshCacheAutomaticallyForGlobals": true,
"refreshCacheWhenElementMovedInStructure": true,
"refreshCacheWhenElementSavedUnchanged": false,
"refreshCacheWhenElementSavedNotLive": false,
"cacheNonHtmlResponses": false,
"trackElements": true,
"trackElementQueries": true,
"excludedTrackedElementQueryParams": [],
"cacheDuration": null,
"nonCacheableElementTypes": [],
"sourceIdAttributes": [],
"liveStatuses": [],
"integrations": [
"putyourlightson\\blitz\\drivers\\integrations\\CommerceIntegration",
"putyourlightson\\blitz\\drivers\\integrations\\SeomaticIntegration"
],
"defaultCacheControlHeader": "no-store",
"cacheControlHeader": "public, s-maxage=31536000, max-age=0",
"cacheControlHeaderExpired": "public, s-maxage=5, max-age=0",
"sendPoweredByHeader": true,
"outputComments": true,
"refreshCacheJobPriority": 10,
"driverJobBatchSize": 100,
"driverJobPriority": 100,
"queueJobTtr": 300,
"maxRetryAttempts": 10,
"maxUriLength": 255,
"mutexTimeout": 1,
"commands": [],
"injectScriptEvent": "DOMContentLoaded",
"injectScriptPosition": 3
} Recommendations
Site Tracking
|
That appears to be a Refresh cache job, not a Generate cache job. Refreshing the cache needs to take place regardless of the refresh mode selected. When using a refresh mode with Blitz appears to be tracking 6,500 entry queries, so there is likely an opportunity to optimise your templates. See https://putyourlightson.com/plugins/blitz#best-practices |
Thanks for the clarification.
If I understand correctly, whatever cache refresh mode is selected, a Refresh cache job is fired for every entry saved.
I have precisely a page where all the entries are present. |
Correct.
Yes, but it is the tracked entry queries that are generally the bottleneck. A well optimised site should have a few dozen queries at most, whereas your has 6,500. Use the Diagnostics utility to better understand how your site’s cached content is structured. |
Support Request
Unexpected cache regeneration behavior with refreshMode = 0
Description
When using Blitz with
refreshMode => 0
(Expire the cache, regenerate manually
), I expect the cache to be regenerated only when:However, I've noticed that whenever an entry is saved, the entire cache is automatically regenerated, despite the setting suggesting manual regeneration only.
Expected Behavior
Cache regeneration should only happen through manual intervention or cron jobs
No automatic regeneration of the entire cache on entry saves
Question
Is this the intended behavior with refreshMode => 0?
If not, how can I achieve the expected behavior described above?
Current Configuration
Environment
Craft CMS version: Craft Pro 5.5.10
Blitz plugin version: 5.9.9
PHP version: 8.2.18
Plugin Version
5.9.9
The text was updated successfully, but these errors were encountered: