craft-blitz icon indicating copy to clipboard operation
craft-blitz copied to clipboard

Cache not refreshing on User updates

Open JMKelley opened this issue 3 months ago • 4 comments

Bug Report

When changing fields for a user in the control panel, the cache is not regenerating. I've added /author/ as an Included URI Pattern.

Diagnostics Report

Application Info

  • PHP version: 8.2.29
  • Craft edition & version: Pro 5.8.19
  • Database driver & version: MySQL 8.0.31

Installed Plugins

  • Blitz: 5.11.3
  • Google Cloud Storage: 2.2.0
  • Imager X: 5.1.3
  • Minify: 5.0.0
  • Redactor: 4.2.0
  • Retour: 5.0.10
  • SEO: 5.0.0
  • Sprig: 3.6.1
  • Super Table: 4.0.4
  • Table Maker: 5.0.5
  • Wordsmith: 5.0.0

Loaded Modules

  • asset-size-checker: modules\assetsizechecker\Module
  • styling-module: modules\stylingmodule\StylingModule
  • codeeditor: nystudio107\codeeditor\CodeEditor
  • sprig-core: putyourlightson\sprig\Sprig
  • verbb-base: verbb\base\Base

Blitz Plugin Settings

{
    "debug": false,
    "hintsEnabled": false,
    "cachingEnabled": true,
    "refreshCacheEnabled": true,
    "refreshMode": 1,
    "includedUriPatterns": [
        {
            "enabled": "1",
            "uriPattern": "\/"
        },
        {
            "enabled": "1",
            "uriPattern": "\/author\/"
        }
    ],
    "excludedUriPatterns": [
        {
            "enabled": "1",
            "uriPattern": ""
        },
        {
            "enabled": "1",
            "uriPattern": "\/blog"
        },
        {
            "enabled": "1",
            "uriPattern": "\/resources"
        }
    ],
    "cacheStorageType": "putyourlightson\\blitz\\drivers\\storage\\FileStorage",
    "cacheStorageSettings": {
        "folderPath": "@webroot\/cache\/blitz",
        "compressCachedValues": ""
    },
    "cacheStorageTypes": [],
    "cacheGeneratorType": "putyourlightson\\blitz\\drivers\\generators\\HttpGenerator",
    "cacheGeneratorSettings": {
        "concurrency": "1"
    },
    "cacheGeneratorTypes": [],
    "customSiteUris": [],
    "cachePurgerType": "putyourlightson\\blitz\\drivers\\purgers\\DummyPurger",
    "cachePurgerSettings": [],
    "cachePurgerTypes": [
        "putyourlightson\\blitz\\drivers\\purgers\\CloudflarePurger"
    ],
    "deployerType": "putyourlightson\\blitz\\drivers\\deployers\\DummyDeployer",
    "deployerSettings": [],
    "deployerTypes": [],
    "ssiEnabled": false,
    "ssiTagFormat": "<!--#include virtual=\"{uri}\" -->",
    "detectSsiEnabled": true,
    "esiEnabled": false,
    "onlyCacheLowercaseUris": false,
    "cacheActionRequests": false,
    "queryStringCaching": 0,
    "includedQueryStringParams": [
        {
            "enabled": "1",
            "queryStringParam": ".*"
        }
    ],
    "excludedQueryStringParams": [
        {
            "enabled": "1",
            "queryStringParam": "gclid"
        },
        {
            "enabled": "1",
            "queryStringParam": "fbclid"
        }
    ],
    "apiKey": "",
    "generatePagesWithQueryStringParams": true,
    "purgeAssetImagesWhenChanged": true,
    "refreshCacheAutomaticallyForGlobals": true,
    "refreshCacheWhenElementMovedInStructure": true,
    "refreshCacheWhenElementSavedUnchanged": false,
    "refreshCacheWhenElementSavedNotLive": false,
    "refreshExpiredCacheAfterVisit": true,
    "cacheNonHtmlResponses": false,
    "trackElements": true,
    "trackElementQueries": true,
    "excludedTrackedElementQueryParams": [],
    "cacheDuration": null,
    "nonCacheableElementTypes": [],
    "sourceIdAttributes": [],
    "liveStatuses": [],
    "integrations": [
        "putyourlightson\\blitz\\drivers\\integrations\\CommerceIntegration",
        "putyourlightson\\blitz\\drivers\\integrations\\FeedMeIntegration",
        "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": 2048,
    "maxUriIndexLength": 767,
    "mutexTimeout": 1,
    "commands": [],
    "injectScriptEvent": "DOMContentLoaded",
    "injectScriptPosition": 3
}

Recommendations

  • ❌ Image transforms are configured not to be generated before page load.
  • ❌ One or more globals exist and refreshCacheAutomaticallyForGlobals is enabled.
  • ❌ Queue jobs are configured to run automatically via web requests.
  • ❌ The blitz/cache/refresh-expired console command has not been executed within the past 24 hours.
  • ✅ Blitz is configured not to refresh cached pages when an element is saved but unchanged.
  • ✅ Blitz is configured not to refresh cached pages when an element is saved but not live.
  • ✅ The @web alias is explicitly defined.
  • ✅ The Async Queue plugin is not installed or enabled.

Site Tracking

  • Tracked Pages: 135
  • Tracked Includes: 0
  • Tracked Actions: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 2330
    • craft\elements\Entry: 1,166
    • craft\elements\Asset: 717
    • craft\elements\Entry: 356
    • craft\elements\User: 62
    • craft\elements\Category: 28
    • craft\models\EntryDraft: 1
  • Tracked Element Queries: 235
    • craft\elements\User: 137
    • craft\elements\Entry: 71
    • craft\elements\Category: 25
    • craft\elements\Asset: 2
  • Tracked Tags: 0

JMKelley avatar Nov 13 '25 09:11 JMKelley

When changing fields for a user in the control panel, the cache is not regenerating.

Can you please clarify what you mean by “changing fields”, and expand on it with an example?

bencroker avatar Nov 13 '25 13:11 bencroker

@bencroker When changing a user's name or even a custom field added to a user no refresh in cache is being triggered. We have Author pages based on the user's fields. Such as a user's biography. When we update this in the control panel, it's staying cached.

JMKelley avatar Nov 13 '25 13:11 JMKelley

This sounds like unusual behaviour. Can you please walk me through the exact steps to reproduce the issue? Please also clear the cache before testing.

bencroker avatar Nov 19 '25 19:11 bencroker

Any update on this, @JMKelley ?

bencroker avatar Dec 10 '25 14:12 bencroker