Preventing cache on a piece of code (on a site that needs cache on other pages)

Author Message

Tony Wood

Monday 23 June 2003 1:59:30 am

eZ ver: 3.0-2 (latest svn for 3.0)
Is there a way of preventing a piece of tpl code being cached? This is on a site the requires cache to be on for speed but a particular page needs to be excluded from the cache.

The main problem is that we are passing a variable via GET to the page and using that to fill a form. The probme is that the cache uses the page id and creates a cache from that. This means that the page always looks the same after the cache is built.

Any ideas on how to prevent a page from being cached?

tia

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Tony Wood

Monday 23 June 2003 2:33:40 am

I have tried expiry but this doesn't work...
i.e. {cache-block keys=$node_id expiry=0}

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Alexei Pechekhonov

Tuesday 24 June 2003 12:30:40 am

It will be cached everything between {cache-block ...} {/cache-block}
Just exclude the {$module_result.content} from cache area.
Then make another cached piece of code, i think. WE have working site by this way and have no one question.

{cache-block keys=array('firstBlock', $var.... }
........ funny code ........
{/cache-block}
{$module_result.content}
{cache-block keys=array('secondBlock', $var.... }
........ funny code ........
{/cache-block}
Hope it'll help.

Paul Forsyth

Tuesday 24 June 2003 12:47:42 am

Unfortunately our setup is as you describe already. We don't use cache-block around our module_result since *_class_*.tpl files are cached anyway (with cache on...).

Inside the full_class we execute our function call {$my_func} to retreive the GET variables. But this whole page gets cached include our function results. Trying an include for our function call doesn't seem to work either as we hoped the include wouldn't be cached. Even trying unique keys for the function call didn't work...

Paul

Brendan Pike

Sunday 06 March 2005 9:03:09 pm

Hi Paul, did you ever find the solution to this problem? I find myself in the same situation with an override template which I use to control enum values in edit mode.

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:17:05
Script start
Timing: Jan 18 2025 16:17:05
Module start 'layout'
Timing: Jan 18 2025 16:17:05
Module start 'content'
Timing: Jan 18 2025 16:17:05
Module end 'content'
Timing: Jan 18 2025 16:17:05
Script end

Main resources:

Total runtime0.0157 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.5234152.6875
Module start 'layout' 0.00550.0032 742.210939.5234
Module start 'content' 0.00870.0048 781.734493.4297
Module end 'content' 0.01360.0021 875.164134.3047
Script end 0.0157  909.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.5360140.0002
Check MTime0.00127.5197140.0001
Mysql Total
Database connection0.00085.145010.0008
Mysqli_queries0.002516.217630.0008
Looping result0.00000.109210.0000
Template Total0.00159.710.0015
Template load0.00084.981310.0008
Template processing0.00074.725010.0007
Override
Cache load0.00053.287510.0005
General
dbfile0.00021.533080.0000
String conversion0.00000.068240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs