New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make URLs immutable #4
Comments
This means I need a good solution for these compile time options while running in development mode |
How about when the service starts up it checks for a compile.json file and, if it is missing, creates it using the same code we run at compile time normally |
Many of the applications I want to implement with this would benefit from having permanent real URLs. So let’s have both. The sha1 urls will serve far future cache headers (and an etag derived from their path). The non sha1 URLs will serve 302 uncached redirects to the sha1 locations. We will have a setting that lets people opt out of this behavior. |
URL design:
So we always redirect to the version with the truncated hash in the URL. |
https://stackoverflow.com/a/18134919/6083 is a good answer about how many characters of the hash are needed to be unique. I say we default to 7 characters, like git does - but allow extras to be configured. |
Can I take advantage of HTTP/2 so even if you get redirected I start serving you the correct resource straight away? |
Looks like the easiest way to implement HTTP/2 server push today is to run behind Cloudflare and use this:
https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/ Here's the W3C draft: https://w3c.github.io/preload/ From https://w3c.github.io/preload/#as-attribute it looks like I should use Unclear if I should throw |
Here's what the homepage of cloudflare.com does (with newlines added within the link header for clarity):
The original header looked like this:
|
Absolutely everything should have a far-future expires header
Part of the URL will be the truncated sha1 hash of the database file itself, calculated at build time
The text was updated successfully, but these errors were encountered: