8 ms·
Is there anything in the HTML spec that tells browsers to always show a cached version a page if it can't be loaded the next time you try to access it? I think
by jimbobthrowawy 2y ago
Is there anything in the HTML spec that tells browsers to always show a cached version a page if it can't be loaded the next time you try to access it?
I think PWAs might have something like that, but haven't tested it in a normal browser or tried building one.
- Dalewyn 2y agoHTML dictates how webpages should be structured and then rendered. You're probably asking about HTTPS, in which case: No. The first rule about HTTPS is no caching, because you want to validate that what you see is from the server and you can't prove that with a cache.
- dntbrsnbl 2y agoYeah, you can do something like that with a ServiceWorker - it does require some JavaScript though. https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Offline_and_background_operation https://developer.mozilla.org/en-US/docs/Web/Progressive_web...
- etaioinshrdlu 2y agoMaybe the entire page could be a self-updating data-url? edit: I tried this and common browser security no longer allows this type of thing. 10 years ago it may have worked.
- greyface- 2y agoHere: data:text/html,<body contenteditable oninput="history.replaceState(0,0,'%23'+btoa(document.body.innerHTML))" onload="if(location.hash)document.body.innerHTML=atob(location.hash.substring(1))">#SGVsbG8sIHdvcmxkIQ==
- TimTheTinker 2y agoBeautiful. Beat me to it. Much better than a relying on an HTTP response from someone else's computer.
- mro_name 2y agoWonderful! How can I silence the Firefox security error messages?
- cvak 2y agoUnfortunately this doesn't work on FF due to security Uncaught NS_ERROR_FAILURE
- jimbobthrowawy 2y agoI'm not getting anything like that, for some reason. I assume I changed a setting and forgot. (probably something to make bookmarklets work) Pasted in URL bar in a new tab, private browsing, FF version 126.0, up to date fedora, history doesn't save.
- cvak 2y agoYeah probably(or corp profile), it works in chrome... Anyway this one works in FF with my settings https://gist.github.com/joakin/f05fd565e8df77a805e21d2d3469d13c https://gist.github.com/joakin/f05fd565e8df77a805e21d2d3469d...