~sircmpwn/pages.sr.ht#10: 
Configurable cache settings

Let users configure cache settings through patterns (fnmatch).

Status
RESOLVED FIXED
Submitter
~misterio
Assigned to
No-one
Submitted
2 years ago
Updated
2 years ago
Labels
No labels applied.

~misterio 2 years ago

I was thinking about implementing this by reading the rules from a file named something like .cachecontrol.

It could then contain rules like this:

*.css max-age=2592000

Does this make sense? Or perhaps there's a better way to do it?

~sircmpwn 2 years ago

I think it would be better to let users configure the cache settings via GraphQL rather than with magic files.

~bitfehler 2 years ago

I am considering picking this up to get more familiar with GraphQL and the related tooling. My general approach would be:

  • Based on an API call (see below), store a given value with the Cache-Control key in one or more objects meta data
  • When serving the object, copy the value from the (already available) meta data into the response header

Questions would be:

  1. Does that approach make sense to you?
  2. The API call: should it be a new one? Or integrated into the upload call?
  3. The input data: do we want to get fancy (e.g. *.css) or keep it simple (full paths only)?

~sircmpwn 2 years ago

I think what this should ideally look like is an update to input SiteConfig which adds an array of (glob, cache-control header value) to the site configuration.

~sircmpwn REPORTED FIXED 2 years ago

Conrad Hoffmann referenced this ticket in commit ac8a24f.

~sircmpwn 2 years ago

Conrad Hoffmann referenced this ticket in commit f209b01.

Register here or Log in to comment, or comment via email.