Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 5 Always load the cached version

Angular 5 Web App - Always loads the cached version or old version i should push ctrl + f5 to get new version and clear cache. i find this solution

@Component({
   selector: 'csj-app',
   templateUrl: 'app/component/app.component.html?v=1.0',
   styleUrls: ['style/app.css?v=1.0']
})

but i get this error when i build with aot

ERROR in : Couldn't resolve resource app.component.html?v=1 
like image 218
user3903484 Avatar asked Jun 12 '26 02:06

user3903484


1 Answers

Remove the URL Parameters. Add --output-hashing=all to your build script.

"build": "ng build --output-hashing=all"

This will stop the cached versions loading.

like image 103
CHAZTATS Avatar answered Jun 13 '26 14:06

CHAZTATS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!