To ensure that the web application displayed in a web browser is current, configure the web application server to send an Expires header.
Web browsers cache data fetched from the web application server on the initial web page load. On subsequent page loads, the server determines if the browser has the most current content saved in the cache. If the content is current, the server returns a 304 response, and the browser continues to use the cached content. If data on the server has changed since the last request, the content in the browser’s cache is considered stale. The server then returns new content and the browser updates the cache with the new content.
Some browsers do not make a call to the server to check for new data unless the cached version is considered expired. These browsers only consider data expired if there is an indicator in the web server response, such as an Expires header.
To avoid displaying old content when a new version of an application is deployed, the web server should send an Expires header in the response. Browsers that rely on an Expires header make a call to the server after the specified expiration time and retrieve any updates to an application file.