cancel
Showing results for 
Search instead for 
Did you mean: 

Force a no-cache header from Alfresco pages

tcunha
Champ in-the-making
Champ in-the-making
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!
2 REPLIES 2

amitev
Champ in-the-making
Champ in-the-making
You can achieve that with servlet filter where you can set the response headers.

tcunha
Champ in-the-making
Champ in-the-making
You can achieve that with servlet filter where you can set the response headers.

Thank you, amitev, this did the trick.  Smiley Happy

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.