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

long term cache workspace and node module files in development #629

Closed
1 of 5 tasks
thescientist13 opened this issue Jun 12, 2021 · 0 comments · Fixed by #760
Closed
1 of 5 tasks

long term cache workspace and node module files in development #629

thescientist13 opened this issue Jun 12, 2021 · 0 comments · Fixed by #760
Assignees
Labels
CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.24.0
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Jun 12, 2021

Type of Change

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

Summary

During development, files like node_modules rarely changing, at least while the dev server is running. Source code files only only change when they, well, change.

This means we should be able to do some really easy and intelligent caching during the lifetime of the development session so repeated requests to files on disk, like node_modules, don't have to initiate a filesystem read. (See #628 )

Details

I think the technique for this is using an E-Tag, which stores a hash of the content as a header and uses it for comparing at request time to see if the header still matches and if not, just return a 304 Not Modified Header. For node_modules we can assume this after first fetch. For user code, only the actual JS, CSS, etc file that changed should actually be refetched.

Additionally, we only need to build importMap once as well, so we should cache that too and not do it on intercept of an HTML page.

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) CLI labels Jun 12, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Jun 12, 2021
@thescientist13 thescientist13 added feature New feature or request and removed enhancement Improve something existing (e.g. no docs, new APIs, etc) labels Dec 25, 2021
@thescientist13 thescientist13 self-assigned this Dec 25, 2021
@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) and removed feature New feature or request labels Feb 20, 2022
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) v0.24.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant