Forums / Developer / Problems with caching...

Problems with caching...

Author Message

K259

Thursday 14 September 2006 1:46:33 am

Hi!

I'm trying to implement a new functionality in our system, but have some problems with caching.

In a folder, I've added a new xml-field. This field is listing content in a right menu.
Everything is working great, but I've created a custom tag with it's own template which fetch the latest 3 articles from another node. This custom tag is inserted in this xml-field and the content is displayed in the right menu, but when I create a new article in the specific node where the fetch is getting the data, this page with the right menu is not updated with the new article.

I've tried to add both:
{set-block scope=root variable=cache_ttl}0{/set-block} in this custom tag template which is inserted in the xml-field on a page, but it don't work. I have also tried:
{cache-block expiry=60} in this custom tag template, but it don't work either.

BUT, when I edit the page which contains this xml-field which also got the custom tag inside, and republish, the latest published article are displayed in the fetch. This means, that I have to republish the page to clear the cache for this page everytime I want a new published article to get displayed, which is not so very effective. I can clear the cache for the page everytime a user is visiting this page(in the template), but this will make the system very slow (without caching for the specific page).

Does anyone have a solution on how I can fix this problem?

K259

Xavier Dutoit

Thursday 14 September 2006 4:13:27 am

Hi,

If you know what node(s) is going to contain the block to refresh, you can use the smartcache settings.

X+

http://www.sydesy.com

K259

Thursday 14 September 2006 4:19:02 am

Hi!

Thanks for the tip,but smartcache is already enabled :/

K259

Thursday 14 September 2006 4:24:25 am

And I also have the sitedesigns set in AvailableSiteDesignList in content.ini..

K259

Thursday 14 September 2006 5:05:43 am

hmm..this is not ez :p

Xavier Dutoit

Friday 15 September 2006 1:51:44 am

Hi

Have you configured something specific in the viewcache.ini for your case ?

X+

http://www.sydesy.com

K259

Friday 15 September 2006 2:04:16 am

No, not for this case.

Marko Žmak

Friday 15 September 2006 2:20:04 am

It seems to me that the problem is that the Folder object that contains this new xml field (where you insert your custom tag) is cached. So when you create a new article in the node where fetch is getting the data, the cache for that node is cleared but cache for the node containing this new xml field with custom tag related with your custom template is not cleared. The result is that yout custom template in which you fetch the data is not executed.

This could maybe be due to ViewCaching being enabled. Try one of this:

1. put {set-block scope=root variable=cache_ttl}0{/set-block} in the template used for view of the node containing this new xml field
...and clear the cache

2. disable ViewCaching
...and clear the cache

3. disable all the cache in the site
...and clear the cache

Try these suggestions one by one and see which one gives you the wanted result. So then maybe you'll be able to tell where exactly is the problem.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

K259

Friday 15 September 2006 2:41:31 am

Marko, this is exactly the problem. When I add {set-block scope=root variable=cache_ttl}0{/set-block} to the main page which got this custom tag template included in its xmlfield, the fetch is ok, but this is a main page, and it needs to be cached..or else the whole system will crash due to overload with processing.

I then need to fix something so that only the custom tag template inside of this xmlfield is cleared(the cache) after a new object is published, so that not the cache for the whole node is cleared.

K259

Friday 15 September 2006 3:02:27 am

I guess there's no solution to this in ez publish today, because not so many have come to this topic with the use of custom tags :(

Xavier Dutoit

Friday 15 September 2006 11:12:50 pm

Hi,

If you know where your custom tag is going to be used and what objects it can include, you can add that in the the smart cache feature.

I usualy have to create relations between one of the published parent's node and the node I want to clear and use some clear override.

That's not that easy to put in place, but I've been using it without problems in most cases.

X+

http://www.sydesy.com

K259

Monday 18 September 2006 1:42:29 am

Xavier..do you have a clue what settings I have to use in the viewcache.ini file?

# clear_object_caches_only
# clear_object_and_parent_nodes_caches
# clear_object_and_relating_objects_caches
# clear_parent_nodes_caches_only
# clear_parent_nodes_and_relating_caches
# clear_relating_caches_only
# clear_all_caches
#ClearCacheMethod=<method_string>

I want to clear the cache for the customtag inside of the xml field of an object of node x..

eZ debug

Timing: Jan 18 2025 10:29:22
Script start
Timing: Jan 18 2025 10:29:22
Module start 'content'
Timing: Jan 18 2025 10:29:22
Module end 'content'
Timing: Jan 18 2025 10:29:22
Script end

Main resources:

Total runtime0.1420 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.6094180.8438
Module start 'content' 0.00600.0048 768.4531105.8516
Module end 'content' 0.01080.1311 874.3047535.7734
Script end 0.1419  1,410.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00312.1622200.0002
Check MTime0.00130.9362200.0001
Mysql Total
Database connection0.00100.725510.0010
Mysqli_queries0.100370.68271410.0007
Looping result0.00120.83281390.0000
Template Total0.130892.110.1308
Template load0.00090.617010.0009
Template processing0.129991.479310.1299
Override
Cache load0.00060.406410.0006
Sytem overhead
Fetch class attribute can translate value0.00090.635310.0009
XML
Image XML parsing0.00030.188110.0003
General
dbfile0.00201.4380200.0001
String conversion0.00000.004430.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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