21288 Posts in 5733 Topics by 2602 members
| Go to End | ||
| Author | Topic: | 3380 Views |
-
Re: Partial Caching - Understanding the Concepts

20 September 2010 at 7:45pm
And the question: if i add <% cached LastEdited %> $Layout <% end_cached %> to Page.ss why StaffPage isn't update when i change StaffItem?
Because it could be that you have cached the block with the last edited date. The nested cacheblocks could have involved some additional caching you don't need. Rather than using a custom cache key could you perhaps experiment with something like
<% cached 'staffitem', Aggregate(StaffItem).Max(LastEdited) %>
You may also want to try and remove the Parent LastEdited Cache (or use <% uncached %> around the middle cache). According to the docs nested caching should work fine but I'm not sure what to look into when it fails.
-
Re: Partial Caching - Understanding the Concepts

21 September 2010 at 4:06am
how can I tell if partial caching is working?
-
Re: Partial Caching - Understanding the Concepts

21 September 2010 at 4:18am
If you see some zend_cache files in the silverstripe-cache/cache folder.
And when you edit content and don't see the changes immediately on the frontend site, unless you use <% cached LastEdited %>, then the cache should be refreshed.Another way is to add ?debug_profile=1 to your url and see the differences in compiling time with and without the partial caching. When using large DataObjectSets, this will difference can be quite huge.
-
Re: Partial Caching - Understanding the Concepts

21 September 2010 at 4:30am
I don't have a cache folder at all...is there a config setting I'm missing?
-
Re: Partial Caching - Understanding the Concepts

21 September 2010 at 6:11am
create a silverstripe-cache directory (writable) in your webroot , SS will use it.
-
Re: Partial Caching - Understanding the Concepts

21 September 2010 at 8:14pm
Is it advisable to apply partial caching on a portion of page generated by ajax?
I have a portion on a page containing multiple tabs. Content of each tab changes when a different tab is clicked. This
is ajax driven.
I tried applying partial caching and experimented with it. It just didn't work and content of the tabs sometimes changes, sometimes they don't.Should I just remove the partial caching from it?
-
Re: Partial Caching - Understanding the Concepts

22 September 2010 at 1:23am
FWIW, for the project I'm working on now I think the best bet for me is staticpublisher for the majority of pages and using partial caching on a few pages that that won't work for.
-
Re: Partial Caching - Understanding the Concepts

15 May 2011 at 2:28am Last edited: 15 May 2011 2:51am
why after adding Partial Caching mysql queries executed again?
what am I doing wrong?in my template Page.ss I add next code
<% cached 'page', LastEdited, CacheSegment %><!DOCTYPE html>
<html lang="$ContentLocale">
<head>
...
...
</html><% end_cached %>In mysite/code/Page.php I add a new method in the Controller:
protected function CacheSegment(){
return $_SERVER["REQUEST_URI"];
}in config.php I have next code
//Director::set_dev_servers(array(
// 'localhost',
// '127.0.0.1'
//));
//Director::set_environment_type('dev');I try chande my template to
<% cached %><!DOCTYPE html>
<html lang="$ContentLocale">
<head>
...
...
</html><% end_cached %>
, but the situation does not change. Queries to the database will still go, though always showing cached pageswhy in my mysql.log I have mo 20 mysql query for load page, and if I refresh page I also have mo 20 mysql query
my mysql.log http://webspilka.com/mylogs/mysql.txt for page and refrash page
| 3380 Views | ||
| Go to Top |






