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

Support for cache refresh of updated pipeline files #1087

Closed
pritamrungta opened this issue Mar 5, 2024 · 5 comments
Closed

Support for cache refresh of updated pipeline files #1087

pritamrungta opened this issue Mar 5, 2024 · 5 comments

Comments

@pritamrungta
Copy link
Contributor

Hi! I'm not fully sure if this is already present, but here's my use-case

I have vite app with all pipelines located in public/itk/pipelines/*[.wasm|.umd.js|...]
Whenever any changes are made in the pipelines, I would like the browser to fetch the updated file (on execution of runPipeline) instead of serving from disk cache.

So, I'm imagining the URLs to be something like https://hostname/itk/pipelines/filter.wasm?_=<app-version> instead of plain https://hostname/itk/pipelines/filter.wasm

Is there a way to configure the query params like the above or any other better alternative to solve the problem?

Thanks!

@thewtex
Copy link
Member

thewtex commented Mar 6, 2024

Hi!

Makes sense.

Perhaps we add a setPipelinesQueryParams to specify query params that are appended to pipeline asset requests for cache busting?

@pritamrungta
Copy link
Contributor Author

pritamrungta commented Mar 7, 2024

Yes, that works.

(I'm also curious if you've encountered the issue more often and if so, what's your general approach to overcome that)

@thewtex
Copy link
Member

thewtex commented Mar 7, 2024

Could you please create a patch?

For production deploys, I often use a service worker, where there is more direct control over the cache. But we should have this feature in ITK-Wasm.

@pritamrungta
Copy link
Contributor Author

Sure, will do.

thewtex added a commit that referenced this issue Mar 11, 2024
feat(itk-wasm): #1087 - Add query params options to pipeline URL
@thewtex
Copy link
Member

thewtex commented Mar 12, 2024

Edit: Released in 1.0.0-b.171.

@thewtex thewtex closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants