You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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!
The text was updated successfully, but these errors were encountered:
Hi Wesley, thanks for the response. The version numbering is automatically applied through an extension to headScript and headLink, which pulls the current release version from a config file updated by our build script. Renaming wouldn't be practical as we're doing it for every js / css file in the repository.
So, rewriting the path before it hits AssetManager - would you be thinking we do that within a small ZF2 module; changing the value in $uri->getPath()? Or did you have something else in mind?
Do you think that AssetManager should examine the content of REDIRECT_URL in order to cater for an invisible rewrite? That would either be a case of assuming that the resolver will always want the rewritten url if it exists, and passing that in as I outlined in my last comment, passing both urls in, or passing the whole Request object to the resolver and allowing it to handle as appropriate. Any thoughts?
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
(whereXX.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:
https://github.com/RWOverdijk/AssetManager/blob/master/src/AssetManager/Service/AssetManager.php#L194
My concerns:
$uri->getPath()
fallback?).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!
The text was updated successfully, but these errors were encountered: