11 Replies Latest reply on Jun 12, 2014 6:47 AM by Kevin.Conaway

    Custom web service cache-control headers

    jameswright

      We have developed a small custom REST endpoint for use with an in house CRM connector. Some responses from this endpoint are very rarely changed, are highly utilized and contain no sensitive information. Is it possible to override the default Cache-Control headers on a per response basis? I have accomplished this with the ResponseBuilder class however after calling .build() and returning the resulting response, it appears the spring context, or jive is adding the cache-control header 'AGAIN' undermining the caching headers I provided resulting in no caching.

       

      2014-05-23_1132.png

      (Notice how the response has the Cache-Control listed twice. (The top one is added after the fact)

       

      The Cache-Control headers being added 'AGAIN' are the standard spring 'security' cache headers: private, no-cache, no-store, must-revalidate, max-age=0..

      So maybe the better question is, how do you turn these off on a custom service?

       

      This is causing less than ideal performance. I was curious if there was a way to change this behavior on a custom core:service

       

      Any help would be appreciated.

       

      Kevin Conaway