Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Workers Sites reuploads files on every change #1005

Closed
EverlastingBugstopper opened this issue Jan 20, 2020 · 6 comments
Closed

Workers Sites reuploads files on every change #1005

EverlastingBugstopper opened this issue Jan 20, 2020 · 6 comments
Labels

Comments

@EverlastingBugstopper
Copy link
Contributor

Using live reload with Workers Sites takes a really long time. It seems that all static resources are re-uploaded on every change, even if the script is the only thing that changed. I also don't see the indicatif changes that were merged here when using live reload. If I use the --verbose flag, I see a bunch of "Preparing" printlns, but it seems like the indicatif progress bar does not increment at the same part of the code.

@ashleymichal
Copy link
Contributor

ashleymichal commented Jan 21, 2020

since live reload already knows what has changed, we can write logic to use that information rather than doing the arduous complete check against what's in KV to decide what files to upload. I would also suggest that we not bother deleting keys from KV during preview sessions, but perhaps consider a clean up step on ^-C that deletes the whole preview namespace. this would decrease the time on live reloads, but not on the initial upload.

this goes pretty well with the work happening on #783 , since that requires we split kv::bucket::sync into two separate operations (upload and bulk delete) around the worker upload.

@EverlastingBugstopper
Copy link
Contributor Author

+1 on using live reload logic for re-uploading, but I think that we should delete keys from KV during preview so that things that should 404 actually 404 in preview

@ashleymichal
Copy link
Contributor

but I think that we should delete keys from KV during preview so that things that should 404 actually 404 in preview

maybe don't block reload on it tho? idk.

@EverlastingBugstopper
Copy link
Contributor Author

we could also parallelize the asset manifest creation with https://github.com/rayon-rs/rayon

@ashleymichal ashleymichal self-assigned this Mar 3, 2020
@ashleymichal
Copy link
Contributor

some of the refactors made for #1115 may help this; namely, that upload_files now takes a list of key value pairs rather than figuring things out itself. i'll explore what i can do to pass the changes from watch to this function rather than running the whole sync against the namespace.

@ashleymichal ashleymichal removed their assignment May 13, 2020
@EverlastingBugstopper
Copy link
Contributor Author

we sync now and also re-hashing doesnt take as long anymore. closing for now - sites cleanup milestone has better stuff

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants