Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

{nocache} and cache_modified_check = true

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
HennessyDotTech
Smarty n00b


Joined: 31 Jan 2020
Posts: 1

PostPosted: Fri Jan 31, 2020 11:30 pm    Post subject: {nocache} and cache_modified_check = true Reply with quote

Using Smarty 3.1.34.

I'm using cache_modified_check = true so that Smarty will send a 304 when a page hasn't changed.

However, I have added a {nocache}{/nocache} section to one template. My expectation is that Smarty would send a 200 response along with the page for every request, since there is a portion of the page that isn't cached.

This isn't what happens, though. I get the 304 response on subsequent visits. The portion within the {nocache} doesn't change (obviously). I have to hit shift+refresh to get a 200 response along with the new page, which defeats the purpose.

Is cache_modified_check not compatible with {nocache}?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1622

PostPosted: Sun Feb 02, 2020 7:51 am    Post subject: Reply with quote

Yes.
https://www.smarty.net/docs/en/variable.cache.modified.check.tpl

If you want a portion of your page change with every request, I suggest javascript and a separate route to fetch always-new block into the page.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP