freeCodeCamp / devdocs

API Documentation Browser
https://devdocs.io
Mozilla Public License 2.0
34.95k stars 2.33k forks source link

Add option to make offline storage persistent #703

Open brianchirls opened 6 years ago

brianchirls commented 6 years ago

Thanks for this awesome site. I missed it terribly this week when I was traveling with a bad or no internet connection and Chrome bumped it from my cache.

Please consider using StorageManager so we can optionally make storage persistent. Thanks.

Thibaut commented 6 years ago

Sorry to hear that :/ I'm eagerly waiting for the Storage API to be implemented in all browsers, so we can do away with all the persistent storage issues.

Before working on this I'd like to see at least one other browser (Firefox) ship the API, and I also need to complete the migration over to HTTPS (Chrome only enables navigator.storage in secure contexts), which is a tricky beast because IndexedDB data is per-origin (i.e. not shared between HTTP and HTTPS), so users will need to migrate their data. Once this done, this feature will be top of my list.

hexpunk commented 6 years ago

@Thibaut I thought devdocs was already https-enabled? https://github.com/Thibaut/devdocs/issues/446

I just switched from http to https and it kept all my settings. :confused:

Thibaut commented 6 years ago

@JayAndCatchFire While DevDocs works over HTTPS, HTTP is still the default (one reason being that until https://github.com/Thibaut/devdocs/issues/633, many docs had insecure assets/images which wouldn't load over HTTPS) . Most people use the HTTP version.

Before implementing persistent storage, I want to force HTTPS, so that the feature is available to everyone. However, forcing HTTPS will nuke all HTTP users' offline data (but not their settings—like you said), so before doing that I need to implement a few things to let the users know and ease the transition.

Kaijiro commented 6 years ago

About the HTTP => HTTPS migration in order to minimize data loss for users I think (once HTTPS is ready to deploy of course) there should be a big notice displayed warning them that due to protocol migration, there data will be lost. We should guide them with an export / import procedure to help them. Maybe should we discuss this point in an other issue ?

graingert commented 6 years ago

@Kaijiro I've made a ticket about that: https://github.com/freeCodeCamp/devdocs/issues/823