Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

reorder caching so images are cached after 1st load #2377

Merged
merged 3 commits into from
Mar 23, 2020
Merged

Conversation

samthor
Copy link
Contributor

@samthor samthor commented Mar 18, 2020

This works around the issue raised over in Workbox.

This isn't specifically tracked but I noticed it while working on JS issues. Images that we aggressively precache (anything in /images/*) weren't be served while offline, because the runtime handler was winning and claiming nothing was found.

As per the other bug:

  • images live under /images/ and include both core site images as well as profile pictures etc
  • we only want to precache the things that appear on the home page
  • but we want to runtime cache any extended images that the user happens to load.

@samthor samthor requested a review from robdodson as a code owner March 18, 2020 02:00
@googlebot googlebot added the cla: yes Contributor has signed the CLA label Mar 18, 2020
@netlify
Copy link

netlify bot commented Mar 18, 2020

Deploy preview for web-dev-staging ready!

Built with commit bcca896

https://deploy-preview-2377--web-dev-staging.netlify.com

@robdodson
Copy link
Contributor

hmmmmmmmmmmmmmmmmm did you notice the percy failure? Not sure why that is...

@samthor
Copy link
Contributor Author

samthor commented Mar 20, 2020

@robdodson I kicked Percy. I reckon it's random whether the lower image loads in time.

@robdodson
Copy link
Contributor

Rebasing so I can verify this works on netlify. I think the deploy was running the old (busted) loader.js code.

@robdodson
Copy link
Contributor

Seems to be working fine on netlify. I tried increasing the wait time on percy to 5 seconds but it still didn't load that image so I'm thinking we'll have to try something else. Maybe we don't load that footer image when we're in a test environment. Percy's great, but if it's flaky folks will complain.

@samthor samthor merged commit f75f11b into master Mar 23, 2020
@samthor samthor deleted the sw-precaching branch March 23, 2020 09:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Contributor has signed the CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants