167
edits
(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 | 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 == | ||