Closed timprint closed 2 years ago
It looks like you have cachingEnabled
set to false
in production.
Also, according to the instructions, Static Caching should be set to Enabled.
I've made those changes but still no joy.
What could cause the "Cached pages" section on the /admin/utilities/blitz-cache page in the control panel to be missing completely?
Well that will only appear when using the File Storage driver. There's no reliable way to fetch the number of cached pages per site using the Yii Cache Storage driver, unfortunately.
Have you looked to see why pages are not being cached in the blitz.log
file?
Ah, the cached pages panel, that makes sense. Thanks.
I think I am getting a bit closer, when I run blitz/cache/refresh the blitz.log has a lot of this.
2022-10-26 21:23:14 [][][debug] An exception has been thrown during the rendering of a template ("Session does not exist in a console request.").
2022-10-26 21:23:14 [][][debug] An exception has been thrown during the rendering of a template ("Session does not exist in a console request.").
2022-10-26 21:23:14 [][][debug] An exception has been thrown during the rendering of a template ("Session does not exist in a console request.").
2022-10-26 21:23:15 [][][debug] An exception has been thrown during the rendering of a template ("Session does not exist in a console request.").
This is a commerce site and I am showing cart info on every page like this.
{{ craft.blitz.getTemplate('/_includes/_cart_link') }}
I'm not sure what else in my templates is calling session info
You should be seeing a full stack trace for that error in one of the Craft log files, perhaps the console
one?
Hi Ben Just to update this for reference. It was my error, I had
{% if cart is not defined %}
{% set cart = craft.commerce.carts.cart %}
{% endif %}
in my main layout template. This was causing a session error when refresh was called via console command. Moving it into a blitz dynamic content block has fixed it.
I did have another issue. Servd instructions for Blitz specify to use Local Warmer. I was getting multiple pages across the site cached as the same page (multiple urls all showing the same template and content). Switching to Guzzle Warmer has fixed this and is working on Servd at the moment. I am waiting to hear back from Servd support about whether this is likely to cause any issues going forward (Servd support have been really helpful).
I believe the Servd instructions specify using the "Local Generator". The Local Warmer is a Blitz 3 concept, which was marked experimental, you can now see why. If the Guzzle Warmer works then great, but the best long-term option is to upgrade to Blitz 4 and use the Local Generator.
I have Blitz working locally OK and previously had it working on Production. I have just moved to Servd hosting and have some set up issues. I have followed the instructions at https://servd.host/docs/caching-with-blitz and am not using Servd's static cache. I have that turned off. This is my blitz config
Local is working OK and pages are being cached.
On Staging and production on Servd the cached pages section is completely missing in the control panel
Running
blitz/cache/refresh
in the Servd control panel on staging I getRunning
blitz/cache/refresh
in the Servd control panel on production I get I getI am all up to date on Craft 3
I'm not sure where to look to try and fix this, Servd's workflow is new to me at the moment and I'm not sure if the issue is there or if I need to change something in my blitz config. Any ideas would me much appreciated.