statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
30 stars 1 forks source link

Warm static page cache on page save #1061

Closed JoeriE closed 5 months ago

JoeriE commented 8 months ago

Hi,

I don't know if it's possible already but it would be nice if static page cache would be invalidated and warmed on page save / publish.

Best wishes, Joeri

duncanmcclean commented 8 months ago

This should be happening already. Are you using the queue at all?

JoeriE commented 8 months ago

@duncanmcclean Oh, I didn't know that. I haven't configured anything expect changing STATAMIC_STATIC_CACHING_STRATEGY to full and adding the rewrites to my htaccess.

duncanmcclean commented 8 months ago

No worries! I only asked since there's an outstanding bug when using the queue and static caching together so wanted to rule that out (statamic/cms#3291).

JoeriE commented 8 months ago

So do I need to set anything up to warm the cache after save? My queue connection is currently sync. It's invalidating the correct page(s), but it's not regenerating the page.

duncanmcclean commented 8 months ago

Apologies, mis-read your issue! Warming entries after clearing them isn't currently possible - there's an existing feature request for that: #977.

ryanmitchell commented 5 months ago

You can do this now using the UrlInvalidated event: https://github.com/statamic/cms/pull/8902

duncanmcclean commented 5 months ago

Closing in favour of #977.