-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(pwa): implement precache #24
Conversation
✅ Deploy Preview for halve-z ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cache size is good.
Awesome, I see how you did that too, I had not considered that approach because I thought I needed to pass all documents, and figured the list would be too big. EDIT: I opened chrome on my android device and visited https://halve-z.netlify.app I then waited 10 seconds which should be plenty of time for the service worker to download assets, and then disabled the data and wifi on my phone. none of the pages like posts or code load, it just shows Offline Mode, no cache/page found. I did look at the code and see the intended implementation though, and have done similar things, it does look like it should be working at first glance. |
Works now for me, I can navigate between the Home, Posts, and Code Pages. I can also browse any of the articles! One thing I really like about the PWA approach in addition to being able to use my site while offline, is that page navigation is instantaneous, heavy bloated sites would never want to use this approach, especially with lots of content, but with these lightweight zola generated static sites the user experience is really improved when everything is cached, all navigation is instantaneous! |
@Jieiku Swell! For heavy sites, it would definitely be a drag, true. For such cases, maybe precache critical assets only and prefetch images, etc., depending on |
yeah, that sounds about right to me, when I was reading about service workers and PWA's, one idea was to have the service worker cache the pages that are linked on a given page in addition to critical assets, that was as you browse any link you could possibly click on that page would get pre-cached. (assuming it is on the same domain) For my own personal site, I like the entire thing cached, I think even with 100s of articles my site would still be pretty light! |
@Jieiku text assets for the win! It might get out of hands in my case—some images are big, though this could be resolved with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dynamic cache worked flawlessly, until I started implementing paginators (#26). I need a break...
Without network information for now.