cloudflare / worker-sites-template

Apache License 2.0
81 stars 39 forks source link

Expires header #38

Closed tillkruss closed 4 years ago

tillkruss commented 4 years ago

Why don’t static assets like SVGs have an expire or max-age header?

exvuma commented 4 years ago

Expire and max-age header will be returned on a response iff the asset is set to cache by the client (i.e. browserCache ) By default only edge caching is set and browser cache is turned off. See https://github.com/cloudflare/kv-asset-handler#browserttl

tillkruss commented 4 years ago

Is there a reason for this, or can I safely enable browserTTL for SVGs?

exvuma commented 4 years ago

Is there a reason for this, or can I safely enable browserTTL for SVGs?

Yes, you can safely apply browserTTL for images and any other resource you'd like cached on the browser