One of the most common and effective ways to manage the caching of your assets is via the
Cache-Control
HTTP header. This header applies to individual assets, meaning everything on our pages can have a very bespoke and granular cache policy. The amount of control we’re granted makes for very intricate and powerful caching strategies.A
Cache-Control
header might look something like this:Cache-Control: public, max-age=31536000
Cache-Control
is the header, and each ofpublic
andmax-age=31536000
are directives. TheCache-Control
header can accept one or more directives, and it is these directives, what they really mean, and their optimum use-cases that I want to cover in this post.…
A great reference for configuring your HTTP caching headers.
0 comments