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