geekflyer / gulp-ui5-preload

Create a Component-preload.js file for openui5 / sapui5 projects
33 stars 10 forks source link

File timestamp of generated preload file is wrong #14

Open Frank683 opened 5 years ago

Frank683 commented 5 years ago

Since the target preload file is created with

var preloadFile = firstFile.clone({contents: false});

all file attributes including creation and modification timestamps are cloned from the firstFile which is the first file coming out of the stream.

This leads to subsequent problems when creating e.g. a sap-ui-cachebuster-info.json file. When the firstFile has not been changed for a long time the Component-preload.js will be listed in the cachebuster file with the old timestamp of the firstFile which will lead to clients loading the outdated version of Component-preload.js from the browser cache despite a newer version being available on the server.

Since this repo is not maintained anymore I just want to report this for any others who might face this problem in the future.

I will try to find a workaround by manually setting the modification date of Component-preload.js after it has been created in my gulp build script.