You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cache-Control header seems a one of confusing point for developer.
for example, as @mnot noted in Cache-Control in the wild | Fastly there are a lot of strange directive combination which says much developer doesn't understand Cache-Control correctly.
So I hope BCP include more important practice around caching.
private / public
mentioning about adding private for private content which must not be stored in shared cache.
and public is not a thing for public content because caches are public by default.
explicit cache-control for heuristic cache
no Cache-Control header doesn't mean un-cacheable. browser could cache them under heuristic caching theory.
so if you have any restriction around caching, adding cache-control header for explicit control.
s-maxage & proxy-revalidate are optional when you do different control for shared proxy. so
if max-age and s-maxage has same value, s-maxage is ommitable.
if must-revalidate is present, proxy-revalidate is ommitable.
throw the kitchen sink is almost meaningless and not only waste bytes but also implementation could cause a problem because no-store and other directives are semantically conflicted.
reload request (max-age=0 or no-cache)
semantically, no-cache should works fine when you do like Reloading of browser.
(but I don't know why browser sends max-age=0 when reloading instead of no-cache.
if there are some reason/use-case for max-age=0 it could be noted here too)
I'll update if I remember more ideas. Correct me if I also misunderstood.
Thanks
The text was updated successfully, but these errors were encountered:
Cache-Control
header seems a one of confusing point for developer.for example, as @mnot noted in Cache-Control in the wild | Fastly there are a lot of strange directive combination which says much developer doesn't understand Cache-Control correctly.
So I hope BCP include more important practice around caching.
private / public
mentioning about adding
private
for private content which must not be stored in shared cache.and
public
is not a thing for public content because caches are public by default.explicit cache-control for heuristic cache
no
Cache-Control
header doesn't mean un-cacheable. browser could cache them under heuristic caching theory.so if you have any restriction around caching, adding cache-control header for explicit control.
see also Twitter Direct Message Caching and Firefox - Mozilla Hacks - the Web developer blog
no-cache is not a "don't cache"
already mentioned is draft
max-age=0 + must-revalidate
it's better to use
no-cache
(almost same bihavior)s-maxage & proxy-revalidate
s-maxage
&proxy-revalidate
are optional when you do different control for shared proxy. soif
max-age
ands-maxage
has same value,s-maxage
is ommitable.if
must-revalidate
is present,proxy-revalidate
is ommitable.throw the kitchen sink
if you really wanna make this not cacheable and avoid store any cache, best choice is to use
no-store
alone.throw the kitchen sink is almost meaningless and not only waste bytes but also implementation could cause a problem because
no-store
and other directives are semantically conflicted.reload request (max-age=0 or no-cache)
semantically,
no-cache
should works fine when you do like Reloading of browser.(but I don't know why browser sends
max-age=0
when reloading instead ofno-cache
.if there are some reason/use-case for
max-age=0
it could be noted here too)I'll update if I remember more ideas. Correct me if I also misunderstood.
Thanks
The text was updated successfully, but these errors were encountered: