Skip to content

Any plan on service-worker for offline usage? #771

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

Closed
JLHwung opened this issue Feb 18, 2017 · 6 comments
Closed

Any plan on service-worker for offline usage? #771

JLHwung opened this issue Feb 18, 2017 · 6 comments

Comments

@JLHwung
Copy link
Contributor

JLHwung commented Feb 18, 2017

The hexo-offline supports using sw-precache to generate a service worker for offline usage on any hexo site.

Browser Support

This was referenced Feb 18, 2017
@chrisvfritz
Copy link
Contributor

As I just mentioned here, I'm definitely not opposed to adding offline support. 👍

@morigs
Copy link
Contributor

morigs commented Feb 19, 2017

I tried hexo-offline with the following configuration:

offline:
  maximumFileSizeToCacheInBytes: 10485760
  staticFileGlobs:
    - public/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}
    - public/**/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}
    - public/manifest.json
    - public/browserconfig.xml
  stripPrefix: public

In general, it works, but I was confused by these errors. I also was not able to properly configure caching CDN scripts and Google fonts, it works only through the browser cache.
Network errors

@JLHwung
Copy link
Contributor Author

JLHwung commented Feb 19, 2017

CDN scripts should be cached using runtimeCaching, see https://github.com/GoogleChrome/sw-precache#runtimecaching-arrayobject

I will document the usage of runtimeCaching on hexo-offline later.

I cannot reproduce the error using the given configuration.

@morigs
Copy link
Contributor

morigs commented Feb 19, 2017

@JLHwung I tried using runtimeCaching, but I could not achieve results without the use of regular expressions.
I think you can not reproduce the error since it occurs because of files that I generated for use with manifest.json (#772).
Maybe you try yourself and send a request? It would be great 😳

@JLHwung
Copy link
Contributor Author

JLHwung commented Feb 20, 2017

Hi morigs,

I've updated the README section to include CDN usage. The runtimeCaching works on the demo site.

I am happy to guide through, don't hesitate to contact me if there is any questions.

chrisvfritz added a commit that referenced this issue May 22, 2017
* #769 Add manifest and icons

* fix ie icons

* simple offline support

* complete offline support
@chrisvfritz
Copy link
Contributor

Fixed in #918

kazupon pushed a commit to kazupon/vuejs.org that referenced this issue Oct 1, 2017
)

* vuejs#769 Add manifest and icons

* fix ie icons

* simple offline support

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

No branches or pull requests

3 participants