Forums / Setup & design / [3.3.0-2] Cache block doesn't really block?

[3.3.0-2] Cache block doesn't really block?

Author Message

Mark Overduin

Wednesday 24 December 2003 6:49:09 am

{cache-block expiry=1}
{"http://www.mydomain.com/bla.php"|marksPHPinsert}
{/cache-block}

The file bla.php shows a different image, each time you load it. But, if I use the above code, it doesn't do what I want it to do. So.. what am I doing wrong here?

I found a file in the cache folder, containing '$contentData = "<img src=http://www.mydomain.com/image1.jpg>";'. This is one of the images bla.php is supposed to show. It should also show image2.jpg and image3.jpg.

-- Mårk :D

ps; Merry Christmas everybody!!

Marco Zinn

Wednesday 24 December 2003 9:23:01 am

Marc, if you need a different HTML code (img-tag) every time you call the page, i think, you cannot use a cache-block at all. Why should you want to cache it, when the contents changes from one call to the next?
Did you want to expire the cache after 1 second with your code? Should work as you expected (judging from http://www.ez.no/developer/ez_publish_3/documentation/incoming/cache_block_optimization). I suggest, that you try without caching first. If this works, maybe there is an issue with including PHP (you used an operator) and cache-block in general.

Marco
http://www.hyperroad-design.com

Mark Overduin

Tuesday 30 December 2003 2:26:02 am

I don't quite understand what you are saying.

Anyways, I'll try to tell you what I have been doing.
Everythin works great if I don't use cache-blocks AND viewcaching=DISabled. But, of course, when my site is ready, I want to enable caching, to give my server a break.

So, I enabled viewcaching. But, now it doesn't work of course, because my included pages (which I include with the operator) are cached. Now I see just one page (static), instead of multiple pages (dynamic). So far, it's all normal and works as expected.

Okay, then I found out there are cache-blocks. Everything within these cache-blocks will not be cached. I read on and found out that the stuff within these cache-blocks do get cached. It will be stored for two hours. But I don't want it to be cached at all!
Well, since I couldn't find anything about real cache-blocking, I used expiry=1, so the created cache should expire after 1 second, am I right? Anyways, this still does not work. The included page still gets cached.

Of course, I checked if the page itself is correct. And it worked great. Each time I load the page, a different image is shown to me.

How can I make this work? Is it possible to really block the page from caching???

-- Mark

Mark Overduin

Tuesday 30 December 2003 5:41:30 am

Still not solved, but I found another solution that will probably fit my needs: http://www.ez.no/developer/ez_publish_3/forum/setup_design/php_works_in_templates_with_viewcaching_enabled

-- Mark

eZ debug

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

Main resources:

Total runtime0.9679 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 587.8438180.8125
Module start 'content' 0.00840.7612 768.6563554.3359
Module end 'content' 0.76970.1981 1,322.9922337.0547
Script end 0.9678  1,660.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.4634210.0002
Check MTime0.00170.1779210.0001
Mysql Total
Database connection0.00100.105710.0010
Mysqli_queries0.870789.95501970.0044
Looping result0.00270.27521950.0000
Template Total0.936696.820.4683
Template load0.00220.224420.0011
Template processing0.934496.539220.4672
Template load and register function0.00020.023910.0002
states
state_id_array0.00080.079610.0008
state_identifier_array0.00080.081720.0004
Override
Cache load0.00190.1934270.0001
Sytem overhead
Fetch class attribute can translate value0.00200.210830.0007
Fetch class attribute name0.00140.140750.0003
XML
Image XML parsing0.00110.111730.0004
class_abstraction
Instantiating content class attribute0.00000.001650.0000
General
dbfile0.02152.2195270.0008
String conversion0.00000.000730.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs