This topic contains 3 replies, has 3 voices, and was last updated by Artem Liubeznyi 5 years, 8 months ago.
- Topic
Currently assets are versioned within Oro by adding the ‘version’ GET argument onto the url:
For example on the demo site:
/css/oro.css?version=3315ead4
We are planning on using a web accelerator in front of our Oro instances as we wish to reduce load on the application servers. The web accelerator ideally would like to cache based on paths rather than GET arguments. So the asset path would become something like:
/assets/3315ead4/css/oro.css
So the formats would be:
BEFORE: <path>?version=<version>
AFTER: /assets/<version><path>We are planning on using rewrite rules to make the ‘/assets/<version>/’ path virtual. So there will be no change to how Oro manages the files but there will need to be a change to how the assets are referenced when generating HTML and loading scripts.
The DynamicAssetVersionStrategyTest within the UIBundle seems to allude that this is possible by using a format similar to ‘%2$s/%1$s’. I understand there may be issues with how requirejs loads them due to the urlArgs callback within RequireJSBundle/Resources/views/scripts.html.twig.
Is this kind of versioning achievable? If not, is it something that could be added to the roadmap?
Cheers.
Brad
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.