Advanced cache setup

View: New views
3 Messages — Rating Filter:   Alert me  

Advanced cache setup

by Magnolia - User mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I am trying to use either ServeUntilRecachedCachePolicy or  
EagerRecacheCachePolicy. I upgraded to 3.6.3 for testing. I setup the  
browser cache expirationMinutes to 0. However, after an activation,  
Magnolia still shows the stale cache. I must clear my browser cache  
to see the up-to-date pages. I'd like to see the up-to-date pages  
after an activation without clearing the browser cache. Please advise.

A side question.... I remember Magnolia 3.6 has a way to decouple  
activation and cache clearing. How do you set that up?



Thanks,
Po Ki

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Parent Message unknown Re: Advanced cache setup

by Magnolia - User mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2008-10-08 at 15:56 -0400, Po Ki Chui wrote:
> Hi all,
>
> I am trying to use either ServeUntilRecachedCachePolicy or  
> EagerRecacheCachePolicy. I upgraded to 3.6.3 for testing. I setup the  

Both of the policies mentioned above will cause server to serve old
content until cache content is updated to prevent spikes in load on a
server due to flushing cache immediately.
ServeUntilRecachedCachePolicy is useful when you have lots of heavy
weight content, for example when you generate images from the content or
other CPU intensive transformations. It will ensure that when first
client requests the page after activation, such request triggers
generation of the page, but if second client comes with the request for
the same page and generation of the page is not finished yet, magnolia
will serve old version of the page not to block this client. From client
perspective it is like the page was activated it later then it was in
reality, but site is much more responsive even immediately after
activation.
EagerRecacheCachePolicy. goes even one step further. It keeps list of
top X (100 by default) served pages and after activation it will
initiate http requests to be the
first-client-who-takes-the-penalty-for-generating-the-page for all the
pages from top list. And only after that it will flush the rest of the
pages from the cache.

Those policies were developed to cover some rather specific needs and in
most cases unless you are running really high loads you do not need to
them at all.

Please read the advanced cache documentation. The above mentioned is
explained there
http://documentation.magnolia.info/modules/advanced-cache.html

> browser cache expirationMinutes to 0. However, after an activation,  

Rather then that change the BrowserCachePolicy to "Never" instead of
"Fixed".

> Magnolia still shows the stale cache. I must clear my browser cache  

If you have to clear the browser cache, then it is not Magnolia that
shows the stale cache.

> to see the up-to-date pages. I'd like to see the up-to-date pages  
> after an activation without clearing the browser cache. Please advise.
>
> A side question.... I remember Magnolia 3.6 has a way to decouple  
> activation and cache clearing. How do you set that up?

Not sure what you mean. You can write your own policy and do what ever
you want. If all you want is to flush the cache manually, at any time,
you can use jmx (there is a mbean for ehcache to do so).

HTH,
Jan

>
>
>
> Thanks,
> Po Ki
>
> ----------------------------------------------------------------
> for list details see
> http://documentation.magnolia.info/
> ----------------------------------------------------------------
--
Best regards,

Jan Haderka
Magnolia International Ltd.

----------------------------------------------------------------------
jan.haderka@...                  http://www.magnolia.info
Magnolia®  - Simple Open Source Content Management
----------------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Parent Message unknown Re: Advanced cache setup

by Magnolia - User mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Jan for your explanation. I do understand the difference for  
the two strategies. However, my point was that the page is still  
serving the old content even after an activation for both strategies  
after half an hour. That is why I turned off the browser cache to  
make sure it's not the browser. I tried the "Never" for browser cache  
configuration and it's still giving me the same behavior. Therefore,  
I wonder what else i could try because I can't expect users to clear  
their browser cache to view the latest content. Magnolia 3.6.1  
actually does show the modified content after an activation for  
ServeUntilRecachedCachePolicy, but not for EagerRecacheCachePolicy. I  
wonder if anyone else encounters the same issue or just me not  
knowing how to configure.

To recap, my only problem to the strategies: how can users view the  
latest content without clearing their browser cache?

Both strategies are brilliant ideas and I truly want to apply them.  
Any hints would be greatly appreciated.


Thanks again,
Po Ki


On Oct 9, 2008, at 2:11 AM, Jan Haderka wrote:

> On Wed, 2008-10-08 at 15:56 -0400, Po Ki Chui wrote:
>> Hi all,
>>
>> I am trying to use either ServeUntilRecachedCachePolicy or
>> EagerRecacheCachePolicy. I upgraded to 3.6.3 for testing. I setup the
>
> Both of the policies mentioned above will cause server to serve old
> content until cache content is updated to prevent spikes in load on a
> server due to flushing cache immediately.
> ServeUntilRecachedCachePolicy is useful when you have lots of heavy
> weight content, for example when you generate images from the  
> content or
> other CPU intensive transformations. It will ensure that when first
> client requests the page after activation, such request triggers
> generation of the page, but if second client comes with the request  
> for
> the same page and generation of the page is not finished yet, magnolia
> will serve old version of the page not to block this client. From  
> client
> perspective it is like the page was activated it later then it was in
> reality, but site is much more responsive even immediately after
> activation.
> EagerRecacheCachePolicy. goes even one step further. It keeps list of
> top X (100 by default) served pages and after activation it will
> initiate http requests to be the
> first-client-who-takes-the-penalty-for-generating-the-page for all the
> pages from top list. And only after that it will flush the rest of the
> pages from the cache.
>
> Those policies were developed to cover some rather specific needs  
> and in
> most cases unless you are running really high loads you do not need to
> them at all.
>
> Please read the advanced cache documentation. The above mentioned is
> explained there
> http://documentation.magnolia.info/modules/advanced-cache.html
>
>> browser cache expirationMinutes to 0. However, after an activation,
>
> Rather then that change the BrowserCachePolicy to "Never" instead of
> "Fixed".
>
>> Magnolia still shows the stale cache. I must clear my browser cache
>
> If you have to clear the browser cache, then it is not Magnolia that
> shows the stale cache.
>
>> to see the up-to-date pages. I'd like to see the up-to-date pages
>> after an activation without clearing the browser cache. Please  
>> advise.
>>
>> A side question.... I remember Magnolia 3.6 has a way to decouple
>> activation and cache clearing. How do you set that up?
>
> Not sure what you mean. You can write your own policy and do what ever
> you want. If all you want is to flush the cache manually, at any time,
> you can use jmx (there is a mbean for ehcache to do so).
>
> HTH,
> Jan
>>
>>
>>
>> Thanks,
>> Po Ki
>>
>> ----------------------------------------------------------------
>> for list details see
>> http://documentation.magnolia.info/
>> ----------------------------------------------------------------
> --
> Best regards,
>
> Jan Haderka
> Magnolia International Ltd.
>
> ----------------------------------------------------------------------
> jan.haderka@...                  http://www.magnolia.info
> Magnolia®  - Simple Open Source Content Management
> ----------------------------------------------------------------------
>
>
> ----------------------------------------------------------------
> for list details see
> http://documentation.magnolia.info/
> ----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------
LightInTheBox - Buy quality products at wholesale price!