-
Notifications
You must be signed in to change notification settings - Fork 100
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
Research a method for caching and using data offline #9
Comments
Hi @postphotos |
Offline commenting I think is out of scope here. That really gets into the realm of background sync. |
Question About offline.php Hi @postphotos, |
@kienstra I think this is separate from the |
Thanks, @westonruter! That was a good idea to be able select a page to display when offline. |
Request For New Issue Hi @postphotos,
|
In my opinion, that opens a very important question. How far should the core-module go? Any other opinions? |
This provides the most basic implementation which allows non-tech people to enable a PWA basic-checklist feature. At the most basic level selecting a page to use for offline gets you going. |
Yes I get that. But if you want to cache an offline page, you also need to cache all files required to show the page. And then that opens more questions. Offline first? Network first? Should this depend on the file type? How should a developer be able to change this behaviour? And why shouldn't we also cache the front page? But the most basic question is: should the core provide PWA features out of the box or should the core only provide the tools? |
An offline page can be as simple as a nice 404 page; thinking along the lines to what GitHub 404 pages look like. The goal is to give the user an experience that is less broken than a Chrome Downasaur, for example. |
@westonruter like the idea of enabling the user to select the page that would be rendered under challenged connectivity situations; although there are some scenarios to be considered. I would start with a simple offline.php. |
@nico-martin on Offline first? Network first? The sensible default which would work for most users is network first. When going offline-first you need to know what you're doing and when to do that in order to avoid sending stale data by default. In my opinion, the features to be added will have to have filters to allow devs to disable the default and do their own thing instead. Like tools + basic defaults. The less wheels you have to turn to get a site to a functional state the more people will be adopting it, or get more interested in doing more. |
@amedina See #23 for more on this. I think actually the |
And yes, the offline page should be served only if the network fails to respond to a request (i.e. network first strategy). Any use of the offline-first strategy for other pages should require explicit opt-in, and to some degree this may be plugin domain as @nico-martin notes. |
I think the Progressive WordPress does that. It offers the user a drop down where he can select an offline page. But to be honest I underestimated the lazyness of most Admins. I came accross a lot of examples where they just picked the front page as the offline page. Because a) they didn't want to write an extra offline page or b) they didn't know what to do an that seemed to be the easiest choice. In my eyes the offline page is not a "page". It's more like a 404 or 500 error. An information coming from the system that something is not the way it should be. So in my opinion, just like the And as @westonruter pointed out in #23 , an offline page should never be used like a normal page. You should never be able to set a link to an offline page. It should hurt when you try to paste the link somewhere (But you still need a unique link for the ServiceWorker). Thats why I would suggest a link outside the url rewrites. Maybe something like And an other cool thing: a theme could then "add offline functionality" by simply adding an Any other thoughts? |
We could also just automatically create an offline There are thousands of themes out there and it would take a long time for them to add an Requiring a special offline template would also not align with the template hierarchy expectation either. A minimal theme is only required to include an |
All of the discussion regarding a dedicated page to serve when offline should be continued on #23. This ticket is more of a general offline consideration which I think is going to largely be out of scope for the PWA plugin, and would rather primarily the domain of plugins that build upon the PWA infrastructure that this plugin is going to propose for core inclusion. |
We're circling back to this in #52 |
As a user, I should have a way to experience a website in poor internet conditions. There should be a way for me to easily save the content that the site has already loaded in cache and not lose it when I click on the next link. In this offline state, I should have meaningful content available to me.
AC1: Continue to extract the learnings from #1 and document approaches in this ticket.
AC2: Provide a prototype or a design approach in this ticket outlining how this should work.
AC3: As a developer I want to know how this works and what I'd need to do to turn this on. I'd also want to know what not to do so that I don't hurt my user's experience or excessively store content, nor accidentally permanently cache dynamic data.
The text was updated successfully, but these errors were encountered: