Skip to content

Increase Cache-Control: max-age= to 1 year instead of 1 month #186

Closed
@getify

Description

I certainly understand not wanting to allow an option to reduce the cache length, as many would probably want. But I have the opposite request: an option to extend the caching beyond the normal (30 days?) length?

My use case is images that are stored in github repos, where the URL includes a specific git commit hash, such as this one:

https://raw.githubusercontent.com/getify/You-Dont-Know-JS/06de0535b240f0d5be8971fbb93d474f0195f767/up%20%26%20going/fig1.png

These images, at these kinds of URLs, will never change, by virtue of how git works. If they change, the URL itself changes. They could be deleted, but that's a separate issue (the in-progress feature for an API to remove from cache).

For some reason, github (via their "raw.githubusercontent" CDN) returns very short caching headers, so it ends up creating unnecessary loads if I link that image for users. I can route these URLs through your service and now there's 30-day caching headers being applied, which is much better for users.

But ideally, I could add an option like "cache-forever" or "long-cache" or something like that, where the image caching header will be 1 year (or even longer), for cases where it's known that the image will never change.

Is this something you would consider adding?

Metadata

Assignees

Labels

completedFeature or request has been completedenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions