Forums / Setup & design / No Cache Settings work

No Cache Settings work

Author Message

Matthias Wittwer

Wednesday 09 January 2008 5:27:06 am

Hello all,
I am working with 3.9.3 and want to use view_parameters.
But the pages are ALWAYS cached and I do not know why.

neither

ViewCaching=disabled
in site.ini.append

nor

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

nor

{cache-block expiry=1}
{$view_parameters.component}
{$view_parameters|attribute('show')}
{/cache-block}

works...
I have to clear the Cache in the backend always manually

Anyone a idea?

any help highly appreciated.

kind regards,
Matthias

André R.

Wednesday 09 January 2008 10:18:40 am

How are the url's (with view parmeters) you are trying look like?
In what template are you doing this (full path)?
Did you place the view cache setting in settings/override/site.ini.append.php?
If you open admin and goes to setup -> ini setting what does it say on that setting?

If it still doesn't work try updating to 3.9.4 or stable/3.9.

btw, newer use cache-blocks in the way you use it in your third example, you are basically caching a very small piece of code that are not even fetching or calculation any thing for the extremely long length of 1 second.
I guess you though it would force the content to be updated every 1 second. But it won't if that code is inside another cache-block or inside a node/object template with viewcache enabled.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Matthias Wittwer

Thursday 10 January 2008 12:34:47 am

Hello André,
thanks for the help, I appreachiate that.

it took me almost a whole day, but the problem was:
in the default pagelayout there is a cacheblock around the $module_result.

{cache-block keys=array($uri_string, $basket_is_empty, $user_hash)}

Pages were not cached with ViewCaching disabled,
just the $view_paramters weren't refreshed when coming the second time to the page.

problem solved.

Sergei Chusmah

Friday 04 April 2008 2:54:01 am

I have a similar problem... I have a form which I'm trying to pre-populate with the current user id.
It works, but the contents are cached, and it always displays the same user id, regardless of the current logged in user!

I've tried several of these solutions (cache-block expiry, set-block ttl, etc...), with no luck. My template is this one...

{default content_object=$node.object
         content_version=$node.contentobject_version_object
         node_name=$node.name
         current_user=fetch('user', 'current_user')}

... form fields including $current_user.login ...

...which is called from another template, this way:

{let form=fetch('content', 'node', hash('node_id', 10091))}
{section show=$form}
{node_view_gui view=full content_node=$form}
{/section}
{/let}

I'm using 3.6.5... Any hint would be appreciated, thanks!

André R.

Friday 04 April 2008 3:37:39 am

And where / what is this 'another template' ?
It is 99.99% + 0.01% probability that it is inside a cache-block or the code is in a node template( witch uses view cache by default).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Sergei Chusmah

Friday 04 April 2008 4:02:38 am

You're right, it is a node template, but then, how can I disable the cache for that node alone?
Is that possible? Of course, disabling the cache for the whole site is not an option...
Thanks for your help.

Sergei Chusmah

Monday 07 April 2008 4:15:09 am

I've been searching for docs on the cache systems, and found that I can clear a node's cache with this:
php ./bin/php/ezcontentcache.php --clear-node=<node-number>

But that's not a solution for my problem either... I'd have to run this script everytime!

What I need is a form where the current logged in user id is sent in the email. I have set up the form as a node with collection information fields (as in the docs), one of which will hold the user id.

But the caching system makes this field to be always the same... I know there must be a simple solution for this! Any hint? Thanks!

André R.

Sunday 11 May 2008 6:15:46 am

In the form template (normally override/templates/full/<class_identifier>.tpl witch means it is a node view full template) add this:

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

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Daniele Nocentini

Monday 12 May 2008 2:16:18 am

what this difference between this codes:

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

and

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

Antica Bottega Digitale srl
http://www.abd.it

André R.

Monday 12 May 2008 9:11:15 am

The variable scope.

Global means the global scope, while root means the scope you are currently in.
Every template you includes create a new variable scope, so it wont workj if you try to set cache_ttl in a included file and not directly in the node view full template and use scope=root.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom