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.