Legacy Knowledge Base
Published Jul. 2, 2025

My CDN cannot cache documents uploaded to Documents and Media

Written By

Laura Li

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • My CDN cannot cache documents uploaded to Documents and Media

Environment

  • Liferay DXP 7.0, Liferay DXP 7.1

Resolution

  • The CDN cannot cache the documents uploaded to Documents and Media because we make Cache-Control header as private for all Documents and Media files which was implemented with LPS-27419. This has been introduced due to security reasons and has been the intended behavior since then. Out of the box, Liferay wants to protect Documents and Media files from being cached. In general, we do not advise caching Documents and Media files on the CDN because it might result in cached versions being served and thus, the files might get leaked to users who should not have access to them.

With that being said, we have created a new feature request (LPS-97027) which makes HTTP Cache-Control dynamic for Documents and Media items. Our Product Team will be asked to evaluate the feasibility of the request. Please feel free to watch the ticket to get notification about the progress on the ticket. 

Did this article resolve your issue ?

Legacy Knowledge Base