Have you considered registering a custom servlet filter to set the response headers before forwarding on?
https://sling.apache.org/documentation/the-sling-engine/filters.html On Wed, Mar 18, 2020 at 2:47 AM Saurabh Tiwari <saurabh.tiw...@hotwax.co> wrote: > Hello team, > > I trying to set the Cache Header in the response header > e.g Cache-Control: max-age=<seconds> in response header in accessing JSON > data. > > I have set up the Sling demo locally following instructions at > > https://sling.apache.org/documentation/getting-started/discover-sling-in-15-minutes.html > > Now, while accessing the JSON data (from below URL) > http://localhost:8080/content/apache/sling-apache-org/index.2.json > I want to set the Cache-Control in the response header for the request > above. > > Kindly let me know if we have any resources available around this. > > The purpose of this implementation is to increase the performance of my > application because in my application this data doesn't change frequently. > > Thanks in advance! > > -- > Best regards, > Saurabh Tiwari > Enterprise Software Engineer > *HotWax Commerce* > *Enterprise open source experts* > http://www.hotwax.co >