putyourlightson / craft-blitz

Intelligent static page caching for creating lightning-fast sites with Craft CMS.
https://putyourlightson.com/plugins/blitz
Other
149 stars 36 forks source link

"Refreshing Blitz cache" jobs apper when the caching is disabled(commerce bug?) #529

Closed Romanavr closed 1 year ago

Romanavr commented 1 year ago

For some reason, I have temporarily disabled Blitz for my site, including tracking elements & their queries. However, while updating the products(from commerce), blitzcache keeps pushing "Refreshing Blitz cache" jobs. What can I do to stop these jobs from appearing? {{ craft.blitz.csrfInput() }} I don't want to completely disable the plugin since I'm using blitz variable for CSRF tokens. I tried every refresh mode, doesn't matter.

My config file(blitz.php):

<?php

return [
    '*' => [
        'cachingEnabled' => false,
        'trackElements' => false,
        'trackElementQueries' => false,
        'warmCacheAutomatically' => false,
        'clearCacheAutomatically' => false,
        'refreshCacheWhenElementSavedUnchanged' => false,
        'refreshCacheWhenElementSavedNotLive' => false,
        'refreshCacheAutomaticallyForGlobals' => false,
        'queueJobTtr' => 60 * 60,
        'enableTemplateCaching' => false,
    ]
];

Some blitz settings from project.yaml :

...
      injectScriptEvent: DOMContentLoaded
      integrations:
        - putyourlightson\blitz\drivers\integrations\CommerceIntegration
      maxRetryAttempts: 10
      mutexTimeout: 1
      outputComments: true
      purgeAssetImagesWhenChanged: true
      queryStringCaching: 0
      queueJobTtr: 3600
      refreshCacheAutomaticallyForGlobals: false
      refreshCacheJobPriority: 10
      refreshCacheWhenElementMovedInStructure: true
      refreshCacheWhenElementSavedNotLive: false
      refreshCacheWhenElementSavedUnchanged: false
      refreshMode: 0
      sendPoweredByHeader: true
      ssiEnabled: false
      trackElementQueries: false
      trackElements: false
bencroker commented 1 year ago

There’s no way to disable the refresh cache process without disabling the plugin. If you no longer need Blitz to cache pages then perhaps you could explore using JavaScript to dynamically load the CSRF tokens.

Romanavr commented 1 year ago

There’s no way to disable the refresh cache process without disabling the plugin. If you no longer need Blitz to cache pages then perhaps you could explore using JavaScript to dynamically load the CSRF tokens.

Okay, thanks!