Forum Discussion
Manipulating origin response
I have a legacy application that I want to put behind cache.
The problem is, the app was not written in such a way that is it cacheable: every request comes in with a sessionKey query parameter and the app generates pages that contain links with that sessionKey query parameter included.
I'm ignoring the sessionKey query parameter in the policy, so pages will get cached, but then then when user B comes along and gets the page from cache, it contains user A's sessionKey.
Originally I was thinking of an iRule that would strip out the sessionKey and replace it with a token, then put a new sessionKey in, but then I realized it would be easier to just change the origin to hand out a token in place of the sessionKey. So now I need an irule to replace the token with the sessionKey from the request query parameter on the response... AFTER cache.
I took the cookie/ssn scrubbing rule on DC and modified for my case, and it works to do the replacement, but since it happens on HTTP_RESPONSE (pre WAM as Dawn pointed out), the page is getting cached with the new sessionKey. Not exactly what I want.
It seems that on a cache hit, the CACHE_REQUEST and CACHE_RESPONSE events get triggered, but you can't seem do do any kind of manipulation like HTTP::collect in the CACHE_RESPONSE event.
Is there ANY way to accomplish this?
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