You are not logged in
Personal tools
You are here: Home Linux.co.uk's Help Centre Plone Howtos Get the Plone Caching system to NOT cache a certain routine.
Document Actions

Get the Plone Caching system to NOT cache a certain routine.

After having problems with the advanced page's rss news feed switching routine, tracked the issue down to Plone telling each browser to cache the page. Heres how to override that, so that all other pages are chached by the browser, except the dynamic segment.

Go to your site setup, or user preferences, and look to the left. You should see "Cache Configuration Tool"... Open that up.

Once you've got that, click on the "Caching rules" tab, and then open the file called "Content". Make sure that the Type you wish to exclude from the caching procedure is selected in the type list.

Now type into the "Cache Preventing Request Values" the tag you are going to use to tell the system you do not want it to cache the item. This will appear after a ? in the URL, so make it friendly. (mine is ?"security_set_context")

Now go to your script. This is the relevant section of mine:

context.REQUEST.RESPONSE.redirect(context.REQUEST['URL1'] + "?security_set_context")

My script, having done it's work, is now redirecting the browser back to the origionating URL, with "?security_set_context" added on the end. (If you go to the Advanced page, and select a different Security feed, you should see "?security_set_context" after the url. This switch tells the cache program that I dont want it to tell the browser to cache this particular page.

"Security_set_context" is also used elsewhere in the script, hence I chose it. Realistically though, you can choose anything, as long as you set the same tag (case sensitive) into theĀ  "Content" file.


So all you need to do now with your site, is add that switch (or its variant) to the URL which you don't want to be cached by the browser.