![]() ![]() Requests that specify an If-None-Match header may receive a 304 Not Modified response if the ETag matches exactly.Ī strong ETag implies exact equality – the response must match byte for byte. Sets a “strong” ETag validator on the response. They can't be used for responses that must be byte-identical, like serving Range requests within a PDF file. Requests that specify an If-None-Match header may receive a 304 Not Modified response if the ETag matches exactly.Ī weak ETag indicates semantic equivalence, not byte-for-byte equality, so they're good for caching HTML pages in browser caches. Sets a “weak” ETag validator on the response. Sets the etag, last_modified, or both on the response, and renders a 304 Not Modified response if the request is already fresh. # => Cache-Control: max-age=3600, public, s-maxage=10800, no-transform=true # => Cache-Control: max-age=3600, private, stale-if-error=300Įxpires_in 1.hour, public: true, "s-maxage": 3.hours, "no-transform": true # => Cache-Control: max-age=3600, private, stale-while-revalidate=60Įxpires_in 1.hour, stale_if_error: 5.minutes # => Cache-Control: max-age=600, public, must-revalidateĮxpires_in 1.hour, stale_while_revalidate: 60.seconds Examples expires_in 10.minutesĮxpires_in 10.minutes, public: true, must_revalidate: true For a list of supported Cache-Control directives, see the article on MDN. ![]() Sets the value of the stale-if-error directive.Īny additional key-value pairs are concatenated as directives. Sets the value of the stale-while-revalidate directive. If true, adds the must-revalidate directive. If true, replaces the default private directive with the public directive. This method will also ensure an HTTP Date header for client compatibility.ĭefaults to issuing the private directive, so that intermediate caches must not cache the response. Sets the Cache-Control header, overwriting existing directives. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |