Forums / Developer / Cache management on admin

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