~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
1 year, 4 months ago
Updated
10 months ago
Labels
No labels applied.

~misterio 1 year, 4 months 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 1 year, 4 months ago

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

~bitfehler 1 year, 1 month 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 1 year, 1 month 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 11 months ago

Conrad Hoffmann referenced this ticket in commit ac8a24f.

~sircmpwn 10 months ago

Conrad Hoffmann referenced this ticket in commit f209b01.

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