Cache transformations based on config as well as file contents #1060
Rich-Harris
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I've been working on a Snowpack/SSR proof of concept, and have run into what appears to be a bug. In that repo, there are two instances of Snowpack running — one that compiles Svelte components in
ssr
mode, and one that compiles them indom
mode.Because the caching is based on the file name and contents, when the browser loads the server-rendered page generated from (say)
App.svelte
, and subsequently loads thedom
version ofApp.svelte
to hydrate the server-rendered markup, Snowpack responds with thessr
version instead because that's what's cached. (Oddly enough it seems to fix itself if you request the file enough times.)It feels like we need to somehow factor Snowpack's configuration into the caching, so that the same file can be transformed differently by different Snowpack instances.
Beta Was this translation helpful? Give feedback.
All reactions