Replies: 1 comment
-
On preview cache logic, see #5470 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
HMR
I'm considering quarto for a development app where resources (File Attachments) will change. It's ideal if other notebook state is maintained.
HMR in other stacks is really attractive for this usecase (state is maintained).
I'm mostly creating Observable - interactive JS pages - and the reactive runtime seems well positioned to do HMR very neatly! In particular for specific resources like FileAttachments.
I haven't looked at the underlying stack behind Quarto, so not sure how amenable that stack is to implement this in Quartos
preview
mode.Since this is a dramatic proposal anyways, and quite apart from more usual Quarto workflows, I understand that this probably won't be added. Interested in what would be involved though and if it might be more broadly useful for the Quarto community.
preview
cache logicThe issue here is now fixed #5470
In the absence of HMR then, there isquarto preview
as-is, and for my purposes I can lose the application state and it's still OK, as long as I can make use of cached resources for responsive reloads (Observable runtime loads external resources from CDNs like jsdelivr/unpkg and from api.observable.com (notebook imports) - & this may also be notable for Quarto users for separate reasons)Trying to analyse/optimise the cache forpreview
I noticed a few things.when a FileAttachment is updated (just as when I edit the source.qmd
file), the reload is significantly worse than me hitting the browser reload button, as resources that are cached on a normal reload are downloaded againAny leads on what the distinction is here? Is it possibly related to the mechanism Quarto uses to trigger a refresh?notebook imports from api.observable.com have a 30s max age in browser cache - after which endpoint must be hit to validate browser cache. Reaching the endpoint to get a 304 response is causing me a significant 400ms delay per import where I am right nowbut I can mitigate this by hosting those notebook imports locally from FileAttachments insteadWhen I understand things better I'll post back, but in case someone already has insight on whats going on, or wants to chime in on HMR, please do :)
Thanks,
Declan
Beta Was this translation helpful? Give feedback.
All reactions