spring - nginx 'interfering' with cache response? -


i have spring web mvc app running in tomcat 7 nginx 1.1.19 in front of tomcat.

i've enabled cache-control:max-age=31536000, must-revalidate spring security , headers returning browser.

if run app directly tomcat works expected, static resources return 304.

running through nginx static resources return 304 , return 200, all show formatted cache-control headers. can't find pattern in , isn't cached.

the nginx confix pretty simple:

location /tsadmin {          proxy_pass http://localhost:8030;          proxy_redirect http://localhost:8030 https://10.10.5.63;  } 

any ideas appreciated.

this turned-out spring security config problem, these 2 snippets resolved issue:

   <http>       <headers>          <cache-control disabled="true" />       </headers>       <intercept-url pattern="/css/**" access="permitall" />       <intercept-url pattern="/frameworks/**" access="permitall" />       <intercept-url pattern="/img/**" access="permitall" />       <intercept-url pattern="/js/**" access="permitall" />       <intercept-url pattern="/fonts/**" access="permitall" />       <intercept-url pattern="/images/**" access="permitall" />    </http> 

and

   <mvc:resources location="/, /css/" mapping="/css/**" cache-period="31536000" />    <mvc:resources location="/, /frameworks/" mapping="/frameworks/**" cache-period="31536000" />    <mvc:resources location="/, /img/" mapping="/img/**" cache-period="31536000" />    <mvc:resources location="/, /js/" mapping="/js/**" cache-period="31536000" />    <mvc:resources location="/, /fonts/" mapping="/fonts/**" cache-period="31536000" />    <mvc:resources location="/, /images/" mapping="/images/**" cache-period="31536000" /> 

fixed things us.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -