Hi,
When I add the following line
SSViewer::flush_template_cache();
and also when I add the following lines
SSViewer::flush_template_cache();
SS_Cache::set_cache_lifetime('any', -1, 100);
HTTP::set_cache_age(0);
to the top of of [root]/mysite/_config.php
I find that elapse time is significantly less than if I add ?flush=1 to the end of the URL.
What is ?flush=1 doing which the code added to _config.php are not?
Indeed I sometimes find that in order to make changes to my templates show when I browse the page I have to resort to adding
?flush=1
to the end of the URL regardless of what code I have added to _config.php. This is a real pain and I would like to avoid having to keep doing this whenever I change a template.
Obviously the above refers to flushing the cache when serving page content. Browser cache may be playing a part here as well. Regarding browser cache, this reduced elapse time which I noticed when I relied on code added to _config.php not only happens when I browse the page using Google Chrome but also when I use IE with the browser set up so that page content is refreshed every time a page is browsed. I think this rules out the part played by the browser cache and points the finger at what is happening when page content is being served.
If anyone could point out to me what ?flush=1 may be doing different to SSViewer::flush_template_cache() and how I may avoid having to keep adding ?flush=1 to the end of the URL, that would be great.
Thanks.