[Solved] Problem with View Parameters and Cache

Author Message

Benjamin Lorteau

Wednesday 01 July 2009 6:38:43 am

Hello everybody,

Today I have a problem with between view_parameters and the caching system. I know for sure that a cached version of the content is created for each call with different view parameters. With this, one can make a pagination inside a container node view.

But in my today's case, when I enable the cache and click on a page number (given by the standard navigator/google.tpl), it always displays the first page.

I thought it was on the fetch level, but all seems fine as it works without caching enabled. Then I checked the value of the variable I compute from the view parameter offset, and it doesn't change when calling the page with or without view parameters. So I figured that it was the computation caching that froze the offset.

Then I checked the $view_parameters.offset value itself just to make sure, and the value doesn't change either !

So, after I clear the view cache, if I click on "http://.../Node/(offset)/30" link, the $view_parameters.offset value is correct (at 30), but if I click immediately after on the "http://.../Node" link, the $view_parameters.offset value stays at 30.

Vice versa, if I clear the cache, click on "http://.../Node" link, the $view_parameters.offset value is correct (at 0), and then if I click on "http://.../Node/(offset)/30" link, the value stays at 0.

I searched thoroughly the forum for an answer, but I didn't find the same exact problem. Usually it's problems like "$view_parameters missing in included templates" or "Limit and Offset parameters missed in fetch".

What should I check now to make sure it's not a bug but (probably) a miss from me ?

(The pagination works perfectly in admin panel, with cache enabled)

eZ Publish personal project : http://www.aeriesguard.com [fr]

André R.

Wednesday 01 July 2009 8:00:35 am

Look true your code and see if there is any unclosed cache-block's or if you on purpose have a cache block around the code that use the view parameter.

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

Benjamin Lorteau

Thursday 02 July 2009 2:23:09 am

Thanks for your reply, André.

I checked pagelayout.tpl, the only place where cache-block would have been defined, although I didn't remember adding any cache-blocks and... shazam !

I wrote my pagelayout from the ezwebin pagelayout, but I forgot to check the cache-blocks closure once my modifications made.

Thanks a lot for your perspicacity, and shame on me for not using existant pagelayout properly.

eZ Publish personal project : http://www.aeriesguard.com [fr]

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 19 2025 11:01:55
Script start
Timing: Jan 19 2025 11:01:55
Module start 'layout'
Timing: Jan 19 2025 11:01:55
Module start 'content'
Timing: Jan 19 2025 11:01:57
Module end 'content'
Timing: Jan 19 2025 11:01:57
Script end

Main resources:

Total runtime1.6827 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0166 589.2813152.6406
Module start 'layout' 0.01660.0096 741.921939.4766
Module start 'content' 0.02621.6552 781.3984546.7188
Module end 'content' 1.68140.0013 1,328.117212.1250
Script end 1.6827  1,340.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2423160.0003
Check MTime0.00140.0809160.0001
Mysql Total
Database connection0.00270.160310.0027
Mysqli_queries1.606095.4389570.0282
Looping result0.00090.0538550.0000
Template Total1.617396.120.8087
Template load0.00200.120620.0010
Template processing1.615395.990920.8076
Template load and register function0.00030.017210.0003
states
state_id_array0.00330.196510.0033
state_identifier_array0.00270.160620.0014
Override
Cache load0.00240.1434230.0001
Sytem overhead
Fetch class attribute can translate value0.00080.045720.0004
Fetch class attribute name0.00180.104150.0004
XML
Image XML parsing0.00320.192620.0016
class_abstraction
Instantiating content class attribute0.00000.000760.0000
General
dbfile0.00410.2465230.0002
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs