Force a no-cache header from Alfresco pages

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2011 01:46 PM
Hello,
We've been asked to make sure that pages from our Alfresco server always have the "Pragma: no-cache" header set.
At first, we thought Tomcat configuration could achieve this, however we've had no success with that.
Is there some simple (or not so simple) way to configure Alfresco to send out a specific header for every page served?
http://forums.alfresco.com/en/viewtopic.php?t=11412 seems to provide some insight into how to accomplish this, however the thread is from 2008 and referers to a class BaseDownloadContentServlet.java.
Maybe there's a similar class that could add the headers for regular pages?
We're using Alfresco 3.4d, by the way.
Thanks in advance!
We've been asked to make sure that pages from our Alfresco server always have the "Pragma: no-cache" header set.
At first, we thought Tomcat configuration could achieve this, however we've had no success with that.
Is there some simple (or not so simple) way to configure Alfresco to send out a specific header for every page served?
http://forums.alfresco.com/en/viewtopic.php?t=11412 seems to provide some insight into how to accomplish this, however the thread is from 2008 and referers to a class BaseDownloadContentServlet.java.
Maybe there's a similar class that could add the headers for regular pages?
We're using Alfresco 3.4d, by the way.
Thanks in advance!
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2011 03:32 PM
You can achieve that with servlet filter where you can set the response headers.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2011 06:47 AM
You can achieve that with servlet filter where you can set the response headers.
Thank you, amitev, this did the trick.

For future reference, and if anyone needs to do something like this, here's how to implement the filter:
http://stackoverflow.com/questions/2876250/tomcat-cache-control
We used the code from the 4th reply.
