Forum Discussion
Jason_40769
Nimbostratus
Mar 30, 2012no-cache Irule
We are wanting to force caching and set the maxage via an irule except on a certain link. We tried this rule but it doesnt seem to work ALL the time. Thoughts?
when HTTP_REQUEST {
DEFAULT cache value for all pages
set cache_value "public, max-age=300"
center should not be cached
if { [HTTP::uri] contains "/center" } {
set cache_value "private, no-cache"
}
}
when HTTP_RESPONSE {
HTTP::header replace Cache-control $cache_value
}
3 Replies
- hoolio
Cirrostratus
Hi Jason,
That iRule looks fine. When you say it doesn't work all of the time what do you mean? Are you seeing some responses without the Cache-Control header set? If so, do you have fast cache or Web Accelerator enabled on the virtual server?
Aaron - Jason_40769
Nimbostratus
We have we Accelerator enabled and ram cache - Jason_40769
Nimbostratus
what happens is we see the "private" insert coming through most of the time but we also see a S-Cache tag through as well... which is strange.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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