Search code examples
httpcachinghttp-headersbrowser-cachecache-control

What happens if the origin web server sets the expires value in response header as a time which is passed relatively long ago?


What happens if the origin web server sets the expires value in response header as a time which is passed relatively long ago.

For instance, consider current time is Fri, 25 Jan 2013 GMT, and the expire header is set as -->

Expires: Thu, 01 Dec 1994 16:00:00 GMT

How will the client respond for the above instance?

Any help would be appreciated


Solution

  • Responding with a past date in the Expired header (earlier than the Date header value) makes no sense and would be a sign of some serious misconfiguration. That being said, clients would treat such response as "already expired" and not cache it. Same applies if Expires date is equal to Date header value (which is the correct way of server marking the response as "already expired") or having an invalid format.

    See the Expires section of RFC 2616 for details.