Forum Discussion
iRule caching images with Ram cache
Hi folks
I'm trying to write an irule that let me cache an uri or part of my website. The situation now is that everything will be cached. So the thing is that we only want to cache img.mywebsite.com/.... I created this iRule, but it doesn't seems to work. Is there something I need to change or add?
Thx
profile http ImagesCache {
defaults from http
ramcache enable
ramcache size 254mb
ramcache max entries 25000
ramcache max age 86400
ramcache min object size 600
ramcache max object size 50000
ramcache uri include http://img\.mywebsite\.com.*\.jpg
ramcache uri include http://img\.mywebsite\.com/.*\.jpeg
ramcache uri include http://img\.mywebsite\.com/.*\.jpg
ramcache uri include http://img\.mywebsite\.com/.*\.jpeg
}
when HTTP_HTTP_REQUEST{
if { [matchclass [HTTP::uri] equals $::cache_uris] } {
cache:enable
} else {
cache:disable
}
}
4 Replies
- Arnaud_Lemaire
Employee
Are you using 10.X ? if yes it's may be related to this issue : ">https://support.f5.com/kb/en-us/solutions/public/12000/600/sol12640.html?sr=41856570" target="_blank">">https://support.f5.com/kb/en-us/solutions/public/12000/600/sol12640.html?sr=41856570
- Drew_123833
Nimbostratus
Hello Arnaud
yes version is important of course :-) I'm using the 11.2 of LTM.
- Arnaud_Lemaire
Employee
always good to know ;)
what is your observed behavior ? content which should not be cached is served from the cache ?
- Drew_123833
Nimbostratus
We have basically a website www.mysite.com. The images are linked in images.mywebsite.com/....jpg and img.mywebsite.com/....jpg. The profile in the webacceleration caches now everything.
We want only to cache the images that are under img.mywebsite.com. Update: in the iRule editor see that he didn't ... accept the profile http ImagesCache, also on class cache uris he has a problem with that:
line 3: [command is not valid in the current scope] [class cache_uris { line 13: [undefined procedure: cache:enable] [cache:enable] line 17: [undefined procedure: cache:disable] [cache:disable]
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
