cmajor-lang/cmajor

The HTTP Server should discard query parameters when resources are requested instead of returning resource not found

giohappy opened this issue · 4 comments

Some bundlers use a timestamp hash for modules loaded asynchronously, to force loading fresh code, or for hot reloading.
For example with Parcel I get something like this:

http://127.0.0.1:51000/session_2453fd8c9/dist/browserAll.19a78b1f.js?1714856241631

where the 1714856241631 portion after the question mark is a cache busting parameter.
Cmajor returns:

The resource '/session_2453fd8c9/dist/browserAll.19a78b1f.js?1714856487233' was not found.

But if I remove the parameter the file is returned as expected.
In my opnion, the Cmajor server should discard any request parameter (at least any parameter that is not interpreted by itself) and return the resource as is.

This does seem sensible, i'll see what can be done

Thanks @cesaref.

Actually, the cache busting mechanism should probably be taken into account by the Cmajor server itself in case it does its own caching...

I haven't digged too much inside the code of the server and the PatchManifest mechanisms for reading resources, but if they implement a cache, it should be invalidated if any parameter is set in the path.

Just to share some thoughts.

There's a fix for this in the latest pre-release (1.0.2496)