IE11 et cache-control rules
Rédigé par gorki Aucun commentaireProblem :
I had a problem, nearly simple : on an angular 11 application, font was not displayed on IE11 on customer site.
After a few tests :
- I reproduce it on my demo site
- I do not reproduce in dev mode
Solution :
Well, I search for a while, and here is a summary.
- IE11 has a problem if header "Cache-Control: nostore" is set for fonts... Not easy to find but there is some reference here
- On my dev, it's working, after a check, I'm not setting Cache-Control: nostore
- On my demo site, I have this header, but I have a Nginx as a reverse proxy. Ok, that's why
- On customer site, I do not have control on network elements. One must add it also
I made the assumption that if I set a Cache directive, intermediate server won't modify it.
It works on my demo site. I'll check next on my customer site.
To add cache control on springboot, thanks Baeldung !
registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/static/hpa-portal/assets/")
.setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS));