Skip to content

Conversation

@Moocar
Copy link
Contributor

@Moocar Moocar commented Jun 11, 2019

Description

page-data.json files are not content hashed. Their value can change between builds and the filename will remain the same. Therefore, in the offline plugin, we should use networkFirst strategy.

Related Issues

@Moocar Moocar requested a review from a team June 11, 2019 23:43
@DSchau DSchau changed the title In plugin-offline, use networkFirst caching for page-data.json files fix(gatsby-plugin-offline): use networkFirst caching for page-data.json files Jun 12, 2019
Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url pattern seems to be working. Should we add a $ to the end of the regex?

I'll give it a spin just to make sure but looks great!

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm. What do you think of adding the $ at the end of the regex?

@Moocar
Copy link
Contributor Author

Moocar commented Jun 12, 2019

Thanks for testing! I don't mind about the $ suffix. The regex is already quite specific. Would it help with performance at all?

@KyleAMathews
Copy link
Contributor

Yeah, seems fine without it. Merging!

@KyleAMathews KyleAMathews merged commit 5352411 into gatsbyjs:master Jun 12, 2019
mxxk pushed a commit to mxxk/gatsby that referenced this pull request Jun 21, 2019
…on files (gatsbyjs#14720)

* In plugin-offline, use networkFirst caching for page-data.json files

* fix page-data offline regex
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

Successfully merging this pull request may close these issues.

3 participants