Open BenReim opened 5 years ago
CC @petermuessig
@BenReim the open-source application cachebuster implementation is aligned with the internal cachebuster implementation for which only the application resources are considered. For the regular runtime resources the runtime cachebuster (src="resources/sap-ui-cachebuster/sap-ui-core.js") should be used but indeed for static applications including libraries this runtime cachebuster is not available and therefore I can see that this might be needed as well.
BTW - I have more a side question regarding the runtime: where do you deploy this library? is there also the server side component available which can handle the application cachebuster requests?
@petermuessig Thanks for explaining that. I was actually using the cachebusting feature provided the grunt-sapui5-bestpractice-build
before - and as you mentioned already - that plugin also didn’t consider static application / library sources. I guess one reason for that might also be that the grunt set-up cannot handle dependencies in the same way as the ui5-tooling does now.
Regarding the deployment, its pretty straight forward: our app bundles are deployed to the SAP Cloud Platform. Although I read somewhere in the docs that the ui5 application cache buster is only supported on NetWeaver, we’ve found that the cachebusting is actually working very well for us on SCP. Using the app cache buster helped us to solve caching-related issues users would run into previously.
@matz3 @RandomByte in this case the best way would be to scan the dist folder rather than the virtual workspace to identify all resources + built dependency resources in the dist folder and to create the cachebuster index out of it. This is another example for what the dist folder would be interesting to have at build time...
Expected Behavior
All run-time resources - including project dependencies - shall be considered cachebusting relevant.
Current Behavior
Currently, project dependencies are not considered – even when they are part of the build result, e.g. when running a build with the
--all
flag. I’m not sure whether this is done intentionally but see issues that could arise from this when relying on the cache busting mechanism. For instance, a browser would not be informed when an app dependency has changed in any way.In case of the ui5lab-app sample, the browser might load a cached library-preload.js file of the ui5lab-library-simple dependency, which might not be compatible with the current app implementation.
Steps to reproduce the issue
Clone ui5lab sample library
git clone https://github.com/UI5Lab/UI5Lab-library-simple
Update to latest version of @ui5/cli
npm install @ui5/cli@latest --save-dev
Build with
generateCachebusterInfo
taskui5 build -a --include-task="generateCachebusterInfo"
Check the content of the generated
sap-ui-cachebuster-info.json
filedist
folder --> Project dependencies (like the ui5-library-sample) are not being considered.