caching - Spring Security - No way to avoid cache-control -


i have application , use controller mapping of spring load images users. (inputstream, response, etc).

in controller set headers cache-control, baseaded on files, etc. there's pragma: no-cache , cache-control:"max-age=0" inside requests, , that's replace response settings.

i trying solve this, nothing works.

i read page , try found that: http://docs.spring.io/autorepo/docs/spring-security/3.2.0.ci-snapshot/reference/html/headers.html

my spring security.xml has:

    <security:headers disabled="true"/> 

anyone have idea solve this?

remember load images need load through controller, never call static directly.

the cache-control headers can controlled on per action basis overriding them in httpservletresponse:

@requestmapping(value = "/foo", method = requestmethod.get) public string someaction(httpservletresponse response) {     response.setheader("cache-control", "no-transform, public, max-age=86400");      // ... } 

no need fiddle spring security configuration.

see http://docs.spring.io/spring-security/site/docs/current/reference/html/headers.html#headers-cache-control.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -