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

New Blitz widget #713

Open jan-dh opened 2 days ago

jan-dh commented 2 days ago

Bug Report

First of all, I really love the new small little "widget" on entry level to get a quick overview of the Blitz cache status. I do notice however that on a multi-site setup it doesn't appear to be working as intended.

I have a multi-site setup with 8 different sites; On one of these sites I have a blogpost that is: Marked as cached in the Blitz diagnostics:

image

I do see the Blitz tags at the bottom of the page:

<!--Cached by Blitz on 2024-09-13T11:36:23+02:00 -->
<!--Served by Blitz on 2024-09-15T10:49:05+02:00-->

But when visiting the entry the page status shows as uncached:

image

Diagnostics Report

Application Info

Installed Plugins

Loaded Modules

Blitz Plugin Settings

{
    "debug": true,
    "hintsEnabled": true,
    "cachingEnabled": true,
    "refreshCacheEnabled": true,
    "refreshMode": 0,
    "includedUriPatterns": [
        {
            "siteId": "",
            "uriPattern": ".*"
        }
    ],
    "excludedUriPatterns": [
        {
            "siteId": "",
            "uriPattern": "***"
        },
        {
            "siteId": "",
            "uriPattern": "***"
        },
        {
            "siteId": "",
            "uriPattern": "***"
        },
        {
            "siteId": "",
            "uriPattern": "blog\/search"
        }
    ],
    "cacheStorageType": "putyourlightson\\blitz\\drivers\\storage\\YiiCacheStorage",
    "cacheStorageSettings": [],
    "cacheStorageTypes": [],
    "cacheGeneratorType": "putyourlightson\\blitz\\drivers\\generators\\HttpGenerator",
    "cacheGeneratorSettings": {
        "concurrency": "3"
    },
    "cacheGeneratorTypes": [],
    "customSiteUris": [],
    "cachePurgerType": "putyourlightson\\blitzcloudfront\\CloudFrontPurger",
    "cachePurgerSettings": {
        "apiKey": "********************",
        "apiSecret": "****************************************",
        "distributionId": "E35TL05JGJ1ANJ",
        "condenseUrls": true
    },
    "cachePurgerTypes": [],
    "deployerType": "putyourlightson\\blitz\\drivers\\deployers\\DummyDeployer",
    "deployerSettings": [],
    "deployerTypes": [],
    "ssiEnabled": true,
    "ssiTagFormat": "<!--#include virtual=\"{uri}\" -->",
    "detectSsiEnabled": true,
    "esiEnabled": false,
    "queryStringCaching": 2,
    "includedQueryStringParams": [
        {
            "siteId": "",
            "queryStringParam": ".*"
        }
    ],
    "excludedQueryStringParams": [
      ***
    ],
    "apiKey": "",
    "generatePagesWithQueryStringParams": true,
    "purgeAssetImagesWhenChanged": true,
    "refreshCacheAutomaticallyForGlobals": false,
    "refreshCacheWhenElementMovedInStructure": true,
    "refreshCacheWhenElementSavedUnchanged": false,
    "refreshCacheWhenElementSavedNotLive": false,
    "cacheNonHtmlResponses": false,
    "trackElements": true,
    "trackElementQueries": true,
    "excludedTrackedElementQueryParams": [],
    "cacheElements": true,
    "cacheElementQueries": true,
    "cacheDuration": null,
    "nonCacheableElementTypes": [],
    "sourceIdAttributes": [],
    "liveStatuses": [],
    "integrations": [
        "putyourlightson\\blitz\\drivers\\integrations\\FeedMeIntegration",
        "putyourlightson\\blitz\\drivers\\integrations\\SeomaticIntegration"
    ],
    "defaultCacheControlHeader": "no-cache, no-store, must-revalidate",
    "cacheControlHeader": "public, s-maxage=2592000, max-age=2592000",
    "cacheControlHeaderExpired": "public, s-maxage=5, max-age=0",
    "sendPoweredByHeader": true,
    "outputComments": true,
    "refreshCacheJobPriority": 10,
    "driverJobBatchSize": 100,
    "driverJobPriority": 100,
    "queueJobTtr": 3600,
    "maxRetryAttempts": 2,
    "maxUriLength": 255,
    "mutexTimeout": 30,
    "commands": [],
    "injectScriptEvent": "DOMContentLoaded",
    "injectScriptPosition": 3
}

Recommendations

Site Tracking [1]

Site Tracking [2]

Site Tracking [3]

Site Tracking [4]

Site Tracking [5]

Site Tracking [6]

Site Tracking [7]

Site Tracking [8]

bencroker commented 2 days ago

The sidebar panel shows a status of Cached only if a cached page exists in the cache storage. The fact that you’re seeing the HTML comments would seem to indicate that the page is indeed cached. Is the page a homepage without a URI by any chance? And can you provide any other details that might be useful?