|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
nasht Smarty n00b
Joined: 25 Feb 2008 Posts: 4
|
Posted: Mon Feb 25, 2008 11:59 pm Post subject: Client-side caching |
|
|
Hi,
I'm looking for some tips on improve client-side caching.
I quickly looked at the Smarty.class.php file and saw a few header() commands like 'Last Modified', "Not Modified' , etc...
I'm not really sure if those are really being used.
I might be wrong but:
- I don't see any Last Modified or Not-Modified headers in my website according to firebug.
- Since only parts of my pages uses smarty, I don't see how Smarty could set any http headers since I already print HTML code before calling Smarty (eventhough I'm actually using an output buffer).
I want to improve client-side caching on my website.
I use Smarty for certain areas of my website, and use smarty caching (I use no expiration caching, and manually clear the cache when an article is modified).
You might like to know that the rest of the page is pretty much static HTML, it never changes.
I was thinking I could manually set header(Last Modified: whatever).
For this, I would need to know when was the smarty template cached last.
I know there is a is_cached() function, but is there a function that would tell me WHEN was this template cached?
If I knew that, since I use output buffer, I could send header("Last-Modified: $cache-time").
Other ideas?
Thanks! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Feb 26, 2008 1:45 am Post subject: |
|
|
You must have caching enabled and set cache_modified_ceck true.
Code: | $smarty->cache_modified_check = true; |
|
|
Back to top |
|
Mds Smarty Rookie
Joined: 12 Jun 2008 Posts: 17 Location: Sari
|
Posted: Thu Jun 12, 2008 12:47 pm Post subject: |
|
|
Thanks U.Tews |
|
Back to top |
|
mychastic Smarty Rookie
Joined: 12 Aug 2008 Posts: 21
|
Posted: Tue Aug 12, 2008 2:35 pm Post subject: |
|
|
Nice one. Thanks! |
|
Back to top |
|
slyydrr Smarty n00b
Joined: 10 Nov 2008 Posts: 4
|
Posted: Mon Nov 10, 2008 4:57 pm Post subject: |
|
|
Awesome, this solved my issue too! |
|
Back to top |
|
|
|
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
|