IF block for request uri in dispatcher
Hi ,
I am looking to set Cache-Control no-cache header for below URL.
Using sling dynamic include for dynamic content and need to make sure component html responds with specific headers to have dispatcher, CDN not to cache.
I have already set up osgi config for sling dynamic include , set component ttl to 0.
I am thinking following would be fine.
<IF "%{REQUEST_URI} =~ '/content/.*\.nocache.html.*'">
Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
Header set Pragma "no-cache"
Header set Age 0
</IF>
http://localhost.company.com:8080/content/invest/en/simple-web/sreeni-test/test-loginaware/_jcr_content/root/container/experiencefragment_l.nocache.html/simple-web/components/content/experiencefragment-login-aware/v1/experiencefragment-login-aware
Please let me know.
I am facing an issue where mainpage.html talking to dispatcher if page loaded with browser refresh.
But, If I copy paste the mainpage.html url directly onto new tab, request not even hitting dispatcher and seems request served either from browser cache or CDN.
more details on the issue:
Unless I provide a query parameter , request never went to dispatcher.
And always returning page from "Disk Cache" which I believe browser cache.
It would be helpful, if anyone could share how can we avoid "Disk Cache" and have the request go to CDN at the least ( I am assuming CDN in turn request dynamic component from dispatcher , publisher)