5 ms·
Looks like Netlify changed something since I wrote this article regarding what headers they send. Detecting support for Range-requests is kinda tricky and relie
by phiresky 5y ago
Looks like Netlify changed something since I wrote this article regarding what headers they send. Detecting support for Range-requests is kinda tricky and relies on heuristics [1]. Not sure why it still works in Chrome though.
You can go to this version of my blog, it should work there:
https://phiresky.github.io/blog/2021/hosting-sqlite-databases-on-github-pages/ https://phiresky.github.io/blog/2021/hosting-sqlite-database...
Maybe the link could be updated?
Except for the DOM demo, since those need some Cross-Site-Isolation Headers you can't set on GitHub Pages (that's the reason I mirrored it to Netlify originally)
[1] https://github.com/phiresky/sql.js-httpvfs/issues/13 https://github.com/phiresky/sql.js-httpvfs/issues/13
- zinekeller 5y agoMaybe because Firefox is stricter? Netlify (incorrectly) sends a 4,583 byte chunk, while GitHub (correctly) sent precisely 1024 bytes. Chrome might just trim it to 1024 bytes, but Firefox just fail-safe at the difference. Edit: Netlify is indeed wrong: asserts in the headers that the content length is 1024 bytes but sends up 4,583 bytes of content. That will definitely fail in Firefox.
- fouc 5y agoAnd it doesn't seem like it'd be easy to get netlify to fix this type of behavior unfortunately: https://answers.netlify.com/t/add-unpacked-content-length-header-for-json-files/1804/2 https://answers.netlify.com/t/add-unpacked-content-length-he...
- pwdisswordfish8 5y agoDon't rely on browser implementation details and a hope that they won't break in the future. Add a small supplementary file to your published data which has a known pattern at a fixed offset, then make a request for that offset and check the response.
- zinekeller 5y agoBrowsers actually implement range-requests correctly, what Netlify has done is advertise support for it but send data incorrectly.
- pwdisswordfish8 5y agoThat doesn't change the thrust of the comment. If you're trying to work around spotty support and detecting the feature is "tricky", then change the program so it performs a small power-on self-test against a known dataset. (And what's the point of crafting a comment in this tone? Is it supposed to be a retort? Whether or not Netlify is doing the wrong thing, if it works in Chrome, but not in Firefox, then that's a materially relevant fact. Don't rely on implementation details and a hope that they won't break in the future.)
- zinekeller 5y agoBecause both Chromium and Gecko follow the IETF (RFC)/W3C specs about this, what Netlify is doing is plain out-of-spec, so what Chromiun and Gecko are doing are implementation details that is explicitly marked as "okay, if you encounter a stupid server that is somehow explicitly advertising range-request support but does it incorrectly, you can do anything and you're still compliant". Drop the request (like Firefox)? Compliant. Silently trim (like Chrome)? Still compliant. Just give zeroes matching the announced length? Yes, still compliant even if you think that's stupid. If you didn't get this simple fact (that is easily verifiable by opening your favourite browser's devtools or even in Fiddler), I don't know how you're not getting this. Yes, it's using heuristics, but Netlify announces support for range-requests so there's no heuristics here to do, either Netlify must remove the header announcing support or Netlify fixes this problem before we talk about heuristics.
- pwdisswordfish8 5y agoWhat do you think any of that has to do with anything? Whether Blink and Gecko are compliant or not was not an issue that was raised, outside of your attempt to raise it. Whether Netlify is doing the wrong thing or not is irrelevant. The original comment was motivated only by the claim that it works in Chrome but not Firefox, and it was an attempt to address that issue. Identifying Netlify as the culprit doesn't make the issue go away any more than gesturing at the criminal statutes solves the problem of someone who is the victim of domestic abuse. Imagine they're being offered guidance on how to enter their home, collect their belongings, and then extract themselves from the situation as cleanly as they can without suffering further violence. Your entire line of reasoning here is tantamount interrupting conversation so you can shout the other person down for how stupid they are while announcing that the plan is unnecessary on the basis that it would be illegal for the victim's partner to give them a thrashing. Yeah, no shit, but once again, totally irrelevant. You're wielding a quiver full of oughts in a conversation about ises. > If you didn't get this simple fact (that is easily verifiable by opening your favourite browser's devtools or even in Fiddler), I don't know how you're not getting this. Reality check: it's you who completely failed to track the salience of the message that you chose to respond to, jerk. Get a fucking clue.