Forum Discussion
Insert header when item added to ramcache
Hi Hendel, I haven't done much with the cache in iRules, but your format for setting appears to be correct. That said, can you post a sanitized version of your iRule and whether you have any other iRules or policies that might be interfering? How are you validating that it is not working? Could use CACHE::trace to see if anything is at least being set by the system before hitting a tcpdump on the wire.
I'm able to log CACHE::headers when I retrieve objects from the cache, it's just that they only come out with all of their original headers/values as sent by the pool member, not the ones I was trying to insert and/or modify as they went in to the cache.
- John_AlamFeb 08, 2023Employee
i used this version and was able to change the headers Cache-Control. I was also able to insert headers. No dynamic values though.
when CACHE_UPDATE { CACHE::header insert X-LTM-Cached "test" CACHE::header replace Cache-Control "private" log local0. "Cache update- path:$path cache: [CACHE::headers]" }
But you have to invalidate the cache before every expected change of behavior. You do that from the CLI with this command:
tmsh delete /ltm profile ramcache optimized-caching
and reload page twice. First reload will not have the cached version.
HTH
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com