Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache handling #168

Closed
BenReim opened this issue Apr 6, 2020 · 5 comments
Closed

Add cache handling #168

BenReim opened this issue Apr 6, 2020 · 5 comments
Labels
author action Waiting for feedback by issue author

Comments

@BenReim
Copy link
Contributor

BenReim commented Apr 6, 2020

Thank you for this showcase project. It comes very handy. 👍

This is an enhancement request. As resource caching is a central issue in todays web applications, it would be nice to add cache-handling to the best-practice-showcase project. Ideally, such a cache handling would take in to account more advance use-cases that are possible with the ui5-tooling, such as custom bundles.

@petermuessig
Copy link
Member

I will try to think about this topic - I have recently played around with yet another cachebuster concept - Easter weekend is coming - maybe I find some time 😄

@BenReim
Copy link
Contributor Author

BenReim commented Apr 17, 2020

Initially, I thought that having a custom task appending some hash to the build bundle (e.g.sap-ui-custom.a294294.js) could be a way. But then I realized that at times, files are not being loaded from the bundle (such in the case of sap/ui/core/ComponentSupport.js).

Additionally, css / json files are currently not being bundled when running a a self-contained build, so that there are requests such:

  • /resources/sap/m/themes/sap_fiori_3/library.css
  • /resources/sap/m/themes/sap_fiori_3/library-parameters.json

...that need to be considered for a cache-handling mechanism as well.

@petermuessig
Copy link
Member

Did you have a look into the ui5-task-cachebuster concept moving the resources into a timestamp folder and keeping the index.html on the root level? I think this should work out for the cache handling supporting all major concepts of UI5.

@petermuessig petermuessig added the author action Waiting for feedback by issue author label Apr 10, 2023
@BenReim
Copy link
Contributor Author

BenReim commented Sep 1, 2023

Hi Peter, i checked the ui5-task-cachebuster - cool approach 👍 I too think this is a solution for most use cases

I could image though that the option of self-contained bundles with unique file names could still come handy, e.g. thinking of more advanced service worker based caching strategies (offline-first use cases etc) - but perhaps that is more of ui5-tooling topic...

@petermuessig
Copy link
Member

Regarding service workers and self-contained bundles, you may look into the ui5-task-pwa-enabler. Two students had the idea to PWAize a UI5 application with the help of a tooling extension. It has also options to select caching strategies. Maybe worth to re-invest into that topic at some point in time as also Safari get slightly better PWA support...

I'll close this issue for now... Thanks for all your inputs and thoughts... Appreciate it and if you have more, just let me know... 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author action Waiting for feedback by issue author
Projects
None yet
Development

No branches or pull requests

2 participants