Recent comments in /f/meta

nitori OP wrote

Ah I see, thanks. In nginx I always use return instead of rewrite (which seems to be the closest to Caddy's redir) so I have to always specify the http response code.

but it won't take effect until I restart it.

Does Caddy not have a reload command like nginx does where you don't have to restart the server to apply the config changes?

2

twovests wrote

The Caddyfile uses a redir directive for www.jstpst.net, which is 302 (temporary) by default. I never looked into it lol. I went in and changed this to a 308 but it won't take effect until I restart it.

That redirects to jstpst.net which is in a separate Caddy entry, which is a reverse proxy over the Docker on port 80. Caddy has HTTP by default and redirects http to https, so I'm guessing that's 308.

That said, as a joke, Caddy lets you use any 3XX code, but sadly, there are no funny ones.

5

nitori OP wrote

Hmm I just looked at what today's Firefox does (since I used Pale Moon's devtools when I checked this out), and apparently it doesn't request the static resource again and therefore does not let the server return a 304, even if there's no Cache-Control header. I wonder what sorcery Mozilla did to determine whether a resource is immutable and therefore safe to just rely on cache when reloading... Or maybe they just decided that they shouldn't bother to look for 304 in every resource whose initiator/cause in the devtools network tab is not "document"... I don't think this aggressive caching is smart since that just increases the likelihood of outdated resources being served when the browser should've revalidated its cache. So I say go for it regardless of what mainstream browsers think lol

3