Skip to content
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

Use HTML5 Appcache #12

Closed
nawroth opened this issue Aug 14, 2014 · 8 comments
Closed

Use HTML5 Appcache #12

nawroth opened this issue Aug 14, 2014 · 8 comments

Comments

@nawroth
Copy link
Contributor

nawroth commented Aug 14, 2014

See for example: http://appcachefacts.info/peterlubbers-owc4/index.html

The best part of using Appcache is -- IMHO -- that either all resource files are refreshed or none.
I've noticed a few times when pushing to gh-pages, that for example loading DocGist or GraphGist will end up with a mix of old and new files. Which usually means some things are broken.

The bad part is that the manifest has to be maintained somhow (or generated, I hope).
Also, changes to the resource files won't be picked up (ever!) unless the manifest gets changed (it might just be a change in a comment).

@mojavelinux
Copy link
Member

I think this is definitely a step in the right direction. The cache GitHub Pages is the one thorn of hosting sites with GitHub.

Another option is to add a ?t= query string to the URL. That busts the cache as well.

Keep in mind if we decide this becomes too much of an issue, we could always consider deploying to OpenShift or Heroku.

@nawroth
Copy link
Contributor Author

nawroth commented Nov 1, 2015

It seems AppCache isn't the way to go any more: https://www.fxsitecompat.com/en-US/docs/2015/application-cache-api-has-been-deprecated/

While looking into this, I also found out that the dynamic loading of syntax highlighters breaks in Firefox, so I'm adding all of them to index.html instead.

@nawroth
Copy link
Contributor Author

nawroth commented Nov 1, 2015

Too early to move on to the Service Worker solution, let's close this for now. http://caniuse.com/#feat=serviceworkers

@nawroth nawroth closed this as completed Nov 1, 2015
@mojavelinux
Copy link
Member

@hsablonniere has a really nice coverage of Service Workers (and the deprecation of AppCache) in his talk from Devoxx BE 2015. See https://www.youtube.com/watch?v=SltjVpgTaCo

@hsablonniere
Copy link

Hi.

I would not say too early. Service Worker embrace progressive enhancement so browser without support will work just fine like before.

What's the use case? Would you want the user to select what's cached? Would you want to try something like last 10 gist avaiblable etc... ?

I would be interested to implement something but we need to discuss a user scenario. And we need a SSL cert (https://letsencrypt.org/ opens its beta on december 3).

@nawroth
Copy link
Contributor Author

nawroth commented Nov 23, 2015

@hsablonniere
The main use case is to make the pages load super fast.
I think it's a very good fit for how AppCache works:

  • Render the page without first checking for updated js/css/html.
  • Make sure the files stay in the cache.
  • Make sure the files are swapped out together in one go.

Next up would be to add a 3.6MB library (https://github.com/mdaines/viz.js/) without affecting the user experience too much.

Storing the last gists visited would be cool!

@mojavelinux
Copy link
Member

I think it's a very good fit for how AppCache works:

I think this is exactly the use case that @hsablonniere proposes is better done with service workers in his talk. AppCache looks seductive on the surface, but in the end it's a douchebag.

Next up would be to add a 3.6MB library (https://github.com/mdaines/viz.js/) without affecting the user experience too much.

Absolutely. We can leverage the tools of the browser to make this all more seamless and speedy. It just seems to me that service workers are a better fit (or @hsablonniere is just very persuasive).

@nawroth
Copy link
Contributor Author

nawroth commented Nov 28, 2015

AppCache is a tricky beast, yes. And as it's on its way out, service workers are no doubt the way to go now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants