-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 deno run --no-cache
flag or { cache: false }
import option to prevent caching of imports
#13754
Comments
its called --reload and its already a thing |
|
I think you are looking for this: #1739 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
why was this closed? |
yes, still need this how about letting remote urls specifying caching behavior in their response with http cache headers? |
Agreed, this would be a great thing to have. I am also importing local modules over HTTP (for the purposes of a plugin/module-federation-type architecture) and would really like to have these modules not cached. You can sort of work around caching imports by adding a query param to your dynamic import that contains a random number (saw this on a GitHub issue somewhere but forget where, sorry for no credit): const location = new URL('http://localhost:8080/myRemoteModule.ts');
location.searchParams.append('denoAntiCache', Math.random().toString()); The issue is that any imports required by the module that you just loaded over the network can still be served from Deno's cache... So the above workaround is only useful for modules that have no dependencies. It would completely solve the issue for me if Deno's caching behavior could be controlled by the presence of the Ideally, I could have the server serving my local modules set |
Feature Request
I would like to be able to prevent Deno from caching imports on certain runs.
Use Case
I want to build a tool that supports importing many different kinds of files, such as
.vue
and.svelte
files, in a server-side dev environment (similar to thevite.ssrLoadModule
function). I know of no good way to transform/compile a local import on the fly, so my solution is to use a local server andimport
the file using the localhost url. This works, except Deno detects those imports as remote, not local, so it caches them. I don't want those files cached, but I can't find any way to prevent it.Proposed API
I think ideally I would like to be able to disable caching on a per-import basis. This could be an extra flag on
import
options, maybe in a specialdeno
section:An alternative would be to support a
--no-cache
flag:The text was updated successfully, but these errors were encountered: