What does expires header with "Thu, 01 Jan 1970 00:00:00 GMT" value means?
Written By
Mariano Alvaro
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
- When retrieving HTML content the following header/value can be found: Expires: Thu, 01 Jan 1970 00:00:00 GMT
- Along with the Expires header the following ones are also sent in the response:
- Cache-Control: private, no-cache, no-store, must-revalidate
- Pragma: no-cache
Environment
- Any Liferay environment where browser cache is disabled.
Resolution
- The mentioned header is set in order to disable the browser cache for HTML content. This option is configurable either for all users (authenticated and guest) or for authenticated users only.
- The following properties can be used to obtain the desired behavior:
#
# Set this to true if you want the portal to force the browser cache to be
# disabled. It will only disable the cache for the rendered HTML response.
# It will not have an impact on static content or other resources.
#
# Env: LIFERAY_BROWSER_PERIOD_CACHE_PERIOD_DISABLED
#
browser.cache.disabled=true
#
# Set this true if you want to disable the cache for authenticated users.
# This property is not read when the property
# "browser.cache.signed.in.disabled" is true. This is useful to ensure that
# authenticated users cannot go to the sign in page by clicking on the back
# button in their browsers.
#
# Env: LIFERAY_BROWSER_PERIOD_CACHE_PERIOD_SIGNED_PERIOD_IN_PERIOD_DISABLED
#
browser.cache.signed.in.disabled=true
- Enabling the browser cache will improve significantly the download speed from a user perspective, but it can cause obsolete content to be displayed if cache isn't cleared, that's why the recommended (and default option) is to disable it.
Did this article resolve your issue ?