caching

Author Message

Jean-Luc Chassaing

Tuesday 09 August 2011 6:38:21 am

Ok so I think that's a big question but I'm actually seeking for the best way to turn that.

Well let's go. On my website front page I have a ajax call that loads many things about user prefs. This call performs a big bunch of PHP script on the server. I would like to cache this.

The question comes here can I use the eZCache and if so how can I do it  so that when cache is purged my cache files will also be purged.

Roman Hutterer

Tuesday 23 August 2011 6:42:18 am

hmm as i understand you want to use the cache mechanism of ez ?

if so why dont you parse a template file at your AJAX call ?
then ezpublish will have the control.

Gaetano Giunta

Tuesday 23 August 2011 7:15:52 am

Using a template for ajax responses is a good idea as long as the data you are showing is coming from a node - because you will benefit of view caching out of the box.

If the data is mixed (coming from different parts of the database), you have to do different things:

- if you are using a "proxy" node to display it, you will have to reset the view cache using the set-block template function to eg. only last five minutes

- if you are using a system template for a custom view of yours, you will need to use the cache-block template function instead, as there is no view cache in action

 

If otoh you want to manipulate caches in php code, you can look up how it is done eg. here: http://svn.projects.ez.no/ggsysinfo/modules/sysinfo/storagechurn.php. You also need to declare your cache in site.ini (eg: http://svn.projects.ez.no/ggsysinfo/settings/site.ini.append.php)

There should be a nice tutorial around from Bertrand Dunogier on this topic, but I cannot find it at the moment - maybe it's in some conference slide set...

Principal Consultant International Business
Member of the Community Project Board

Jerome Despatis

Wednesday 24 August 2011 4:01:05 am

I'm also interested in this resource!

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: Feb 18 2025 00:48:28
Script start
Timing: Feb 18 2025 00:48:28
Module start 'layout'
Timing: Feb 18 2025 00:48:28
Module start 'content'
Timing: Feb 18 2025 00:48:28
Module end 'content'
Timing: Feb 18 2025 00:48:28
Script end

Main resources:

Total runtime0.0108 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.0040 613.9688151.1875
Module start 'layout' 0.00400.0016 765.156336.6016
Module start 'content' 0.00560.0038 801.757894.2188
Module end 'content' 0.00940.0014 895.976633.9766
Script end 0.0108  929.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002724.6143140.0002
Check MTime0.001513.6822140.0001
Mysql Total
Database connection0.00065.990210.0006
Mysqli_queries0.001210.879130.0004
Looping result0.00000.083910.0000
Template Total0.001110.310.0011
Template load0.00098.091510.0009
Template processing0.00022.129910.0002
Override
Cache load0.00065.961610.0006
General
dbfile0.00032.703880.0000
String conversion0.00000.055240.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