-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Hi guys, looking for a bit of input on this one please. We've just implemented a cache busting module which adds a rewrite rule to catch paths of the format (for example) /my/path/myfile.XX.XX.XX.js (where XX.XX.XX is a version number) and invisibly rewrite these to /my/path/myfile.js.
We are using the PathStackResolver, and AssetManager attempts to locate an asset with the pre-rewritten name including the version number. This doesn't find anything and the file access fails. My initial thought was whether AssetManager should actually be using the REDIRECT_URL parameter to grab the post-rewritten name excluding the version number? For example, this change:
$fullPath = $request->getServer('REDIRECT_URL') ?: $uri->getPath();
My concerns:
- the reliability of REDIRECT_URL (possibly semi-negated by a
$uri->getPath()fallback?). - whether there are circumstances you would actually want the pre-rewritten url, possibly in resolvers that are not path related.
I've been talking in terms of cache-busting and version numbers but of course this would apply to any invisible rewrite situation... Appreciate your thoughts!