Cache management on admin

Author Message

Eric Bourgain

Thursday 01 December 2005 1:03:39 am

Hi everybody,
I come with a problem really important for me.
I design an estension on the admin side to let the administrator choose from there the colors of the main parts of its site (menu, <hN> tag, etc...). It works fine, but she/he has to type the color codes. So I have designed a color picker. The idea is to store the color chart of the site in an ini file, and to let the administrator choose among them.
So I have a color picker (an applet java), a form and a javascript, and everything works fine... almost.
When I arrive on the color picker page, the already choosen colors are displayed. There I can add new colors, remove some other, then store the colors. It works fine so far, but when I come back to this page, I just get the original colors displayed, and not the new set.
I thought that I had a problem with the ini cache, as I was storing data in an ini file. I called a resetCache method on my ini file. It didn't work.
In fact, after some tries, I found that I had to clear both data and templates cache to get the updated set of colors.
This is not usable with an online site, because it clears all the templates./data cache!
So I'm looking for a way to avoid caching for my specific template. I read in a news about an abracadabra formula (put {set-block scope=root variable=cache_ttl}0{/set-block} at the beginning of the template) that was said to prevent template caching. I don't know if it does anything, but it is not enough.
Has anybody an idea of how to perform this?

Eric

Łukasz Serwatka

Thursday 01 December 2005 1:07:34 am

You can use:

{set-block scope=root variable=cache_ttl}0{/set-block}

at the beginning of file together with {cache-block} for part of template that should be cached. So you will only omit caching for part of tpl file not for whole.

More about cache block you can read here:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_functions/miscellaneous/cache_block

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Eric Bourgain

Thursday 01 December 2005 10:52:32 am

I did this, as it was stated in my initial post. It does not work!

Eric Bourgain

Friday 02 December 2005 1:22:46 am

Łukasz Serwatka

Friday 02 December 2005 2:14:55 am

Could you paste here this part of your tpl which should be always refreshed, and some parts around it?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Eric Bourgain

Friday 02 December 2005 3:01:02 am

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 31 2025 04:32:32
Script start
Timing: Jan 31 2025 04:32:32
Module start 'layout'
Timing: Jan 31 2025 04:32:32
Module start 'content'
Timing: Jan 31 2025 04:32:32
Module end 'content'
Timing: Jan 31 2025 04:32:32
Script end

Main resources:

Total runtime0.0210 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.1328151.2109
Module start 'layout' 0.00470.0032 739.343836.6484
Module start 'content' 0.00790.0113 775.992294.1406
Module end 'content' 0.01930.0016 870.132837.9922
Script end 0.0209  908.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002511.7297140.0002
Check MTime0.00104.9516140.0001
Mysql Total
Database connection0.00073.389110.0007
Mysqli_queries0.002913.971630.0010
Looping result0.00000.071710.0000
Template Total0.00125.510.0012
Template load0.00094.533910.0009
Template processing0.00020.977610.0002
Override
Cache load0.00073.288910.0007
General
dbfile0.00031.217780.0000
String conversion0.00000.042140.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