Forums / General / [Solved] Problem with View Parameters and Cache

[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]

eZ debug

Timing: Jan 19 2025 08:48:29
Script start
Timing: Jan 19 2025 08:48:29
Module start 'content'
Timing: Jan 19 2025 08:48:30
Module end 'content'
Timing: Jan 19 2025 08:48:30
Script end

Main resources:

Total runtime0.8998 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 592.6953180.8203
Module start 'content' 0.00720.7686 773.5156551.8125
Module end 'content' 0.77580.1240 1,325.3281336.7500
Script end 0.8997  1,662.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.4864210.0002
Check MTime0.00170.1915210.0001
Mysql Total
Database connection0.00090.103610.0009
Mysqli_queries0.827591.96531940.0043
Looping result0.00190.20691920.0000
Template Total0.860795.720.4304
Template load0.00220.245020.0011
Template processing0.858595.408120.4292
Template load and register function0.00010.011710.0001
states
state_id_array0.00180.204310.0018
state_identifier_array0.00070.072520.0003
Override
Cache load0.00190.2112230.0001
Sytem overhead
Fetch class attribute can translate value0.00110.124630.0004
Fetch class attribute name0.00120.131550.0002
XML
Image XML parsing0.00140.151830.0005
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00360.4010340.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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