Comments (8)
This means I need a good solution for these compile time options while running in development mode
from datasette.
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
from datasette.
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.
from datasette.
URL design:
/database/table.json - redirects to /database-6753f4a/table.json
So we always redirect to the version with the truncated hash in the URL.
from datasette.
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.
from datasette.
Can I take advantage of HTTP/2 so even if you get redirected I start serving you the correct resource straight away?
from datasette.
Looks like the easiest way to implement HTTP/2 server push today is to run behind Cloudflare and use this:
Link: </asset/to/push.js>; rel=preload; as=script
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 as=fetch
if the content is intended for consumption by fetch() or XMLHTTPRequest.
Unclear if I should throw as=fetch crossorigin
in there. Need to experiment on that.
from datasette.
Here's what the homepage of cloudflare.com does (with newlines added within the link header for clarity):
$ curl -i 'https://www.cloudflare.com/'
HTTP/1.1 200 OK
Date: Mon, 23 Oct 2017 21:45:58 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
link:
</vendor/bitdashplayer.min.css>; rel=preload; as=style,
</vendor/bitdash-controls.min.css>; rel=preload; as=style,
</video/marketing-video/cloudflare-marketing-video.mpd>; rel=preload,
</video/marketing-video/cloudflare-marketing-video.m3u8>; rel=preload,
</video/marketing-video/video_0_800000/dash/init.mp4>; rel=preload; as=video,
</video/marketing-video/audio_0_128000/dash/init.mp4>; rel=preload; as=video,
</video/marketing-video/video_0_800000/dash/segment_0.m4s>; rel=preload; as=video,
</video/marketing-video/audio_0_128000/dash/segment_0.m4s>; rel=preload; as=video,
</video/new-short-optimized-22.mp4>; rel=preload; as=video,
</video/marketing-video/poster.jpg>; rel=preload; as=image
The original header looked like this:
link: </vendor/bitdashplayer.min.css>; rel=preload; as=style, </vendor/bitdash-controls.min.css>; rel=preload; as=style, </video/marketing-video/cloudflare-marketing-video.mpd>; rel=preload, </video/marketing-video/cloudflare-marketing-video.m3u8>; rel=preload, </video/marketing-video/video_0_800000/dash/init.mp4>; rel=preload; as=video, </video/marketing-video/audio_0_128000/dash/init.mp4>; rel=preload; as=video, </video/marketing-video/video_0_800000/dash/segment_0.m4s>; rel=preload; as=video, </video/marketing-video/audio_0_128000/dash/segment_0.m4s>; rel=preload; as=video, </video/new-short-optimized-22.mp4>; rel=preload; as=video, </video/marketing-video/poster.jpg>; rel=preload; as=image
from datasette.
Related Issues (20)
- Automatically hide type=shadow tables in SQLite 3.37 or higher HOT 1
- view_actions() hook, to avoid showing table actions on view pages that don't work HOT 6
- Homepage actions button on / index page HOT 3
- row_actions() plugin hook HOT 2
- Add more group headers to the plugin hooks page HOT 1
- Refactor row/table/view/query/database/homepage action menus to use same HTML HOT 1
- Add a bit of a gradient to the header and maybe the footer HOT 2
- Release Datasette 1.0a13 HOT 3
- Better wrapping of breadcrumbs when user is logged in HOT 1
- Facet by JSON array configuration
- Fix httpx deprecation warnings HOT 1
- Mechanism to skip MD5 cache in local development HOT 3
- Document maximum rows allowed per batch in JSON Write API HOT 1
- Actions menu sometimes displays behind datasette-cluster-map controls HOT 1
- Official Docker image of Datasette does not support VirtualKNN2
- Cannot install plugins on desktop variant HOT 4
- 'Datasette' object has no attribute 'table_metadata' HOT 5
- Database download missing content-length header and is sent chunked
- Run spell check against all of the documentation HOT 5
- Async example for track_event plugin hook HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datasette.