-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Duplicate cache headers in spring boot 1.5.1 #8188
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
Comments
Neither of those things has changed as far as I know. Have you dug into why it no longer works? I'm guessing that the headers aren't getting set as you intend. It should be possible to verify that without involving IE, for example by using curl. Can you provide a small sample that illustrates the problem? |
Just by looking at the request, it appears that the default content type has changed from spring 1.4.4 for eot type fonts from application/octet-stream to application/vnd.ms-fontobject |
As far as I can tell, there's no content type in 1.4.4:
With 1.5 it's
That change is a result of this commit. We added some more mappings when upgrading to a new version of Undertow as we make sure that the mappings are consistent across all three supported embedded containers (Tomcat, Undertow, and Jetty). If that change is what's causing your problem (you haven't confirmed that yet) then I don't think there's anything we can do about it and you'll have to find an alternative workaround. |
It looks like this is loosely linked to #8176 I took a quick look on the deployment server and it looks like my cache headers are in fact being 'overridden'. Spring boot 1.5.1
Spring boot 1.4.4
It looks like before it wasn't adding the Pragma / Cache-Control / Expires headers if they were already defined but now they are added regardless. Locally this it works fine for me but I don't have a https connection locally and this bug is only available with https. Also, I forgot to mention that this is when deploying to weblogic, I'm not sure if it's relevant or not. |
This issue's all over the place at the moment. So it looks like you're now saying that the You haven't said how you've configured the static resource handling and where you've configured the caching. As you can see in the curl output I shared above you won't get any caching headers by default so you must have configured something that's setting them in addition to your custom filter. Can you please share some code that reproduces the problem? |
Yes, the Content-Type header had nothing to do with it. The only place where i am configuring cache is the internet explorer filter that I previously mentioned. There is really nothing to show on the spring boot configuration. The filter registration bean that i previously mentioned is the only thing that configures anything, everything else is simple controllers / authentication. |
I'm trying to AOP the httpservletresponse to see if i can figure out where the headers come from but i'm not having any luck doing that. |
Found it, it's in CacheControlHeadersWriter Before, the writeHeader method used to write
Now, it's simply
This is the commit spring-projects/spring-security@57d7ad0 |
sample project here it turns out that WebSecurityConfigurerAdapter enables the cache control headers that you were missing happens with a weblogic deployment
|
Thanks for tracking it down. As you've noted /cc @rwinch |
There's this bug in IE that the fonts from fonts awesome don't work very well with https. It has some problems with caching or something. (see FortAwesome/Font-Awesome#6454 )
To get around this, we set up a filter registration bean.
The Internet Explorer Https Font filter would just set the http request headers to
This worked fine until 1.4.4, but on 1.5.1 it no longer works. I'm guessing that the way to set headers has changed lately or that the filters should be registered differently?
The text was updated successfully, but these errors were encountered: