0

Our client uses IE8, and its caching-hungry ways makes things difficult. To fix this I added a bean to prevent caching

<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
    <property name="cacheSeconds" value="0" />
</bean>

According to Chrome's (Very useful) developer tool, I can see that Response Headers are:

Cache-Control:no-cache
Cache-Control:no-store
Content-Length:1070
Content-Type:text/html;charset=utf-8
Date:Tue, 27 Nov 2012 17:21:31 GMT
Expires:Thu, 01 Jan 1970 00:00:00 GMT
Pragma:no-cache

However, now I'm getting a 406 response. Why would I be getting this?

The Request Headers are:

Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:redacted
Host:localhost:8040
Referer:http://localhost:8040/redacted
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
X-Requested-With:XMLHttpRequest

I took a look at this answer, but I'm already using Jackson.

Community
  • 1
  • 1
Jesse Jashinsky
  • 10,313
  • 6
  • 38
  • 63

1 Answers1

0

Found the answer. Once again it's a problem with how the beans are ordered. If I place the no-cache bean AFTER the jackson bean, then it works.

Jesse Jashinsky
  • 10,313
  • 6
  • 38
  • 63