Forum Discussion
Henrik_Janhagen
Sep 16, 2011Nimbostratus
HTTP::uri rewrites in combination with RAM cache
Hello, I have bit of a problem with HTTP::uri rewrites in combination with RAM cache.
My problem is that the application I have running on my VIP is called with uri's like this:
...but the developers wants this to hit the underlying realservers with the "unique=6_26&" part removed. (I asked them to remove it from the calling application but no dice :) )
So. I wrote a little iRule like this:
when HTTP_REQUEST {
regsub -nocase unique=.*& [HTTP::uri] "" HTTP::uri
}
...and that worked just fine for awhile.
Now however these same developers want me to cache the responses to these rewitten calls in RAM cache on the F5. I.e. if two end-users makes two calls each like this:
user 1 calls ,
and,
user 2 callstwice.
(note the difference in the links? The only difference is the value of 'unique')
The loadbalancer should then only make ONE call to the real servers. (Since once the uri has been re-written "in-flight" for these two calls they are exactly the same).
However that is not what is happening when I enable caching on my VIP. Instead both users have 1 call each passed to the realservers. My gut feeling is that I need to play with CACHE::uri somehow so that the cache created from user 1's first call is used when user 2 makes his calls.
But I just can't figure out how to do that.
I hope my question makes sense... English is not my native language. :)
Best Regards
Henrik
- Michael_YatesNimbostratusHi Janhagen,
- Henrik_JanhagenNimbostratusHello Michael and thanks for your reply!
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "unique" } { regsub -nocase {unique=.*&} [HTTP::uri] "" uri CACHE::uri $uri HTTP::uri $uri } }
- Henrik_JanhagenNimbostratusHehe...
{unique=.*&}
or{unique=.*?&}
{unique=[^&]*&}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects