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

route partial filenames should be hashed based on file contents #547

Open
1 of 5 tasks
thescientist13 opened this issue Apr 11, 2021 · 0 comments
Open
1 of 5 tasks
Labels
CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) Router
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Apr 11, 2021

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Currently route partials for the mpa mode just get named based on their route, which as a name won't change from build to build.

const outputPath = `${outputDir}/_routes${url}`
public/
  _routes/
    about/index.html
    index.html

But, the content does and so to avoid any issues with caching, and just like with CSS / JS, we should hash these filenames based on content to be self cache busting by default.

Details

The main obstacle here is that all the content needs to be known up front because the generated routes have to include entries for all pages. Since currently this happens page by page in serialize.js, there is no guarantee of order, it's all happening in parallel.

Saved a WIP branch here.

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) CLI Router labels Apr 11, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Apr 11, 2021
@thescientist13 thescientist13 changed the title route partial filenames should include a hash based on content route partial filenames should be hashed based on file contents Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) Router
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant