Closed maks-humeniuk closed 4 years ago
It seems that I confused changing file name with its URL. So, something like src="/path/to/script.js?t=1592490407282"
would work, while renaming script.js
to script.js?t=1592490407282
won't, at least on Windows.
I spent around 4 hours to figure out that
Error: ENOENT: no such file or directory
is caused by adding?
to file extension, however#
works.Example:
I'm trying to bust cache with this approach, and I can't modify
basename
, because it'll change file name, hence code, which requests file, won't find it. So, instead ofscript.1592490407282.js
I needscript.js?t=1592490407282
, because it's pretty much the same asscript.js
, at least it was so for a long time and usually used to bust favicon cache.