Hi Rakesh,

It isn't completely clear what you are trying to achieve?

If there is no difference in the rendered pages based on the cookie, then I see 
no reason why you should not be able to use the standard magnolia cache...
In this case you simply need to configure your filter-chain so that the 
cookie-checking-filter is executed *before* the cache-filter. This way the 
cookie-checking-filter will only let authenticated requests through, which will 
then be answered either by the cache or by rendering, depending on whether the 
content was already cached or not.

If you want to cache different versions of the page depending on the cookie or 
some property of the cookie, you need to modify the behavior of the cache. 
Basically, this involves creating a subclass of the CacheKey which includes 
your new property as a part of the cache key. Then you need to subclass a 
couple of other classes to make sure they use your new cache-key, and supply 
the parameter on creating it. It's not hard to do.

Regards from Vienna,

Richard





-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Rakesh Vidyadharan (via Magnolia Forums)
Gesendet: Dienstag, 08. Oktober 2013 22:29
An: Magnolia User List
Betreff: [magnolia-user] Cache pages while ignoring cookie data?

Hello,

I am working on a site where a part of the content is protected.  We are not 
using Magnolia authentication for this.  We have another SSO application which 
handles the authentication and authorisation.  The way I handle this at present 
is through a filter which checks the request for a valid cookie failing which 
the request is redirected to the SSO application.  The filter also takes care 
of updating the cookie expiration etc.  This part works well.

I would still like to be able to cache the pages.  None of the templates or 
model classes access the cookie, all the UI personalisation is handled through 
JavaScript.  The ideal scenario would be for our filter to take care of the 
cookie handling, and Magnolia takes care of caching and rendering the pages 
while ignoring the cookie header.  From what I can see the cache includes the 
cookie header as well, which wreaks havoc with all the sessions :-).

What would be the best way to go about addressing this problem (sub-classing 
the caching filter, request/response wrappers ...)?

Thanks in advance for all help and suggestions.
Rakesh

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=1c9860e3-5a24-4b05-a8aa-cb7dac86a6b7


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------





----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to