HTTP Caching: Difference between revisions

Jump to navigation Jump to search
No change in size ,  18 January 2021
m
(Created page with "One of the often overlooked superpowers of HTTP is the built in support for caching. This allows you to only spend the effort of generating a response every so often inste...")
 
Line 7: Line 7:


== Time Based Caching ==
== Time Based Caching ==
An easy way to implement caching is by specifying that a response is valid for a certain amount of time. For example if your resource is static and the same for all users you can set the following [[Cache-Control Header]]: <code>Cache-Control: public,maxage=300</code> This will keep the resource in your cache for five minutes.
An easy way to implement caching is by specifying that a response is valid for a certain amount of time. For example if your resource is static and the same for all users you can set the following [[Cache-Control header]]: <code>Cache-Control: public,maxage=300</code> This will keep the resource in your cache for five minutes.


== ETag Based Caching ==
== ETag Based Caching ==

Navigation menu