All posts tagged: Cache

Liferay : Overwrite Cache-Control headers in Document Library files

No comments
DLFileEntry from Document library are downloaded from WebServerServlet, that is adding Cache-Control: private header but no other caching instruction (like max-age or Expires) is appended.

ServletResponseUtil will override the Cache-Control header, no matter what was set before. In this particular case, when trying to modify the header using the HeaderFilter will fail because the portal will override it with a hard-coded value later on.

Overwrite Cache-Control headers settings.

  1. Shut down the portal.
  2. Edit the <tomcat_home>/webapps/ROOT/WEB-INF/liferay-web.xml
  3. Add the following filter mapping:
V3A InfoLiferay : Overwrite Cache-Control headers in Document Library files
read more