Share » Forums » Setup & design » Implementing caching- cache-block...

Implementing caching- cache-block questions

Implementing caching- cache-block questions

Tuesday 13 May 2003 4:12:32 am - 5 replies

Author Message

Paul Forsyth

Tuesday 13 May 2003 5:33:58 am

arthur,

move the cache block to before the {let test=fetch... this will create a php cache of the results of the database calls - rather speeds things up :)

also, try this type of cache-block instruction. instead of caching just a single variation of your page it will work if you have dynamic pages that depend on changes between the node.

{cache-block keys=array('stories', $DesignKeys:used.node)}

finally, copy this contribution to your local ez files:

http://ez.no/developer/ez_publish_3/contributions/binshellclearcachesh_fix_to_clear_cacheblocks

this will allow you to clear cached files between tests... many a time ive wondered whats going on with cache off and finding cache being created...

paul

arthur foelsche

Tuesday 13 May 2003 8:25:47 am

wow- that made a huge different in page load times! Thanks! Its great to have people helping out in this fourm!

arthur foelsche

Tuesday 13 May 2003 4:20:57 pm

thanks for your help. I now understand what you were saying about wanting to use a different kind of caching for dynamic content- here you mentioned this call:

{cache-block keys=array('stories', $DesignKeys:used.node)}

should i replace stories and used.node with my particulars? or is this the format that i should use?

thanks again!

Paul Forsyth

Wednesday 14 May 2003 3:30:07 am

You should replace 'stories' with your own variables when you use the cache-block. Remember, this is an id so its not a good idea to use the same id more than once otherwise the id may index the same cached file...

Dont replace the $DesignKeys as that is an ez variable used when cache is on.

However, saying that, the particular example i gave works well since its allows your variable to be indexed. For example, if you have dynamic content for each node it may be seen as {stories, 1}, {stories, 2}, etc, and there will be a cached page for each.

One upshot of this is that more disk space will be used for cache (for each node) but you get better performance.

We are still experimenting with this so hopefully will learn the ins and outs with time :)

Paul

Paul Forsyth

Wednesday 14 May 2003 3:31:40 am

Try this program on this site:

http://www.joedog.org/siege/index.shtml

It allows you artificially stress your site and will give speeds on access. Ez use it i believe.

Paul

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu