hoodiehq / faq

Frequently asked questions about Hoodie
faq.hood.ie
11 stars 3 forks source link

Progressive Enhancement #107

Open varjmes opened 9 years ago

varjmes commented 9 years ago

If you turn JavaScript off, all you can see in this app is a header and a footer.

Obviously, this isn't very accessible for people on slow connections, mobile phones and other non-js-friendly situations. I'd like to know if anyone has any basic thoughts on how you can still offer some kind of help when someone visits the site without JavaScript.

To fully combat this would probably involve not relying on AngularJS to serve the content. However; that is a very large task and one a little beyond me at this stage.

I was thinking about a simple "The JavaScript content couldn't be served, follow this link to see the GitHub issues". Better yet, perhaps serve static HTML that corresponds to the three most asked questions. I know you can use the <noscript></noscript> tags to serve special content if JavaScript won't load, but I am unsure how reliable that is.

I guess I'd just like to hear some of thoughts on whether you think that this is something that could be tackled / how you would go about solving this kind of problem.

lewiscowper commented 9 years ago

I definitely like the idea of a <noscript> tag to provide the link to the FAQs on Github as a really quick win.

A further enhancement would be adding a service worker to provide caching of requests once the user has visited the site once. This also has the benefit of second visits being significantly faster across supported devices, and can be done in a progressive enhancement friendly way.

However the crux of the matter is we fetch on every page load, but the FAQs aren't updated that quickly, so static-ifying the content and providing a link to the appropriate GH issue, perhaps with a behind the scenes request to add any info we don't have already. I'd quite like to take on doing at least a subset of this.

As far as I can see we have a few things we could do with this issue.

janl commented 9 years ago

Since ServiceWorkers are still being rolled out, let’s do the noscript first. In a next step, I think server-side rendering of some sort is in order, but that would make things a little more complicated to operate, but that’s okay. Then we can speed that up with ServiceWorkers.

basically: yes :)