Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
348 views
in Technique[技术] by (71.8m points)

networking - In SAPUI5, is there a possibility to load all images of a page beforehand?

I am starting with web/Ui5 development and I am using UI5/HTML/JavaScript to build this website.

I have a problem with images being loaded every time I navigate across the different tabs of the <IconTabBar - IconTabFilter>. Even after changing the image sizes to less than 10kb they still sometimes load very slow, in like 3 or 4 seconds, with that old 1995 loading animation from top to bottom.

I want to get rid of this in any way possible, the option I believe is the most appropriate one is to eager load all images on the initial page load and keep them somehow cached so they don't get loaded all the time again and again. Is that something possible to do? Or do you think something else is the problem?

This is the loading recording on chrome:

Loading Screen 1 Loading Screen 2

These are the scripts on my HTML

<script id="sap-ui-bootstrap"
        src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
        data-sap-ui-theme="sap_fiori_3"
        data-sap-ui-libs="sap.m, sap.ui.layout, sap.tnt"
        data-sap-ui-resourceroots='{"Quickstart": "./"}'
        data-sap-ui-onInit="module:Quickstart/index"
        data-sap-ui-compatVersion="edge"
        data-sap-ui-async="true">
</script>

This is an example of my page where you can see the tabs and also the icons that load unsynchronized.

Example of tabs

question from:https://stackoverflow.com/questions/65879817/in-sapui5-is-there-a-possibility-to-load-all-images-of-a-page-beforehand

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...