Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
I just enabled caching on my site using 2.0. When I edit the file in the admin panel and visit it, I'm shown the generated (correct) page, but when I go back as a regular user, I'm still shown the old cached page.

Also I have a question in general...can couch detect when a template has changed even if the editable data hasn't changed? Will it invalidate the cache when that happens, or ONLY when save is pressed in the admin panel?

(I can PM my site details if you need them. I'm using a custom .htaccess, however I tried with the default and had the same problem).
Hi @Mako88,

As a temporary solution, you may add &nc=1 to url to disable cache for visited page.

Detection doesn't work outside of cms:template block, is it what you asked?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
.can couch detect when a template has changed even if the editable data hasn't changed? Will it invalidate the cache when that happens, or ONLY when save is pressed in the admin panel?
No, I'm afraid, it cannot. One must press save somewhere in the admin-panel to bust the cache.
OK, I guess I can go re-save a page to bust the cache after I edit a template :)

But currently, even hitting save isn't invalidating the cache.
Mako88 wrote: But currently, even hitting save isn't invalidating the cache.

Maybe it's because no data has been changed?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
I tried removing or adding a word to the editable section on that page and then hitting save. When I'd check it as super-admin it would be changed (since it's a non-cached page), but when I'd logout and look at it with a non-user, it'd still be showing the old cached page (even on refreshing).
@Mako88, could you please try making the following change? -
edit 'couch/theme/_system/content_form.html' snippet, find the following piece of code within it -
Code: Select all
<cms:db_persist_form 
    _token=k_cur_token
/>

- and change it to follows -
Code: Select all
<cms:db_persist_form 
    _invalidate_cache='1'
    _token=k_cur_token
/>

I think that should solve the problem.
Do test it and let me know.

Thanks.
Yeah, that fixed it! Thanks!

What exactly did that do?
Thanks for the confirmation.

It was actually an oversight on my part and that missing statement should really have been a part of that snippet in the first place - without it the cache won't get busted upon saving a page (as you were experiencing).

I'll commit the change to the core now.

Thanks :)
9 posts Page 1 of 1