Ram Cache with Include list

Hi F5 Community,

i want to share with you TWO issues i encountered with Ram Cache behaviour on BIG-IP devices.

These issues are related to “Include list” usage for “HTTP Ram Cache” profile.

Here is my testing environnement :

- BIG-IP LTM 10.2.0

- 1 VS with a custom HTTP profile (http_cache)

- 1 custom HTTP profile with Ram Cache enable

- 1 Group with 1 Node (Apache Webserver)

My Apache webserver pages tree :

- index.php (including two resources 1 JS & 1 CSS)

- objet.js

- style.css

My expectations regarding Ram Cache :

- I want Ram Cache to cache only files with extension “.js” and “.css”, so in my environnement only the files “objet.js” & “style.css”

=================

1°) First issue :

=================

When i configure my “http_cache” profile as followed :

- Ramcache “Enabled”

- Maximum Cache Size “10”

- Maximum Entries “10000”

- Maximum Age “3600”

- Minimum Object Size “500” (default value)

- Maximum Object Size “50000” (default value)

- URI List Include Lise “*.js” & “*.css”

- Ignore Headers “All”

- Insert Age Header “Enabled”

- Aging Rate “9”

And then i execute the following request :

- GET /index.php

The BIG-IP caches the following files “index.php”, “objet.js” and “styles.css”

-------------

bp>profile http http_cache ramcache entry show

PROFILE HTTP http_cache - Ramcache Entry:

±> Host: helloworld.com URI: /index.php

…

±> Host: helloworld.com URI: /objet.js

…

±> Host: helloworld.com URI: /style.css

…

bp>

-------------

But when i configure RAM Cache profil as this :

- Minimum Object Size “0”

- Maximum Object Size “0”

And then execute the following request :

- GET /index.php

The BIG-IP caches the good files; only “objet.js” and “style.css”

-------------

bp>profile http http_cache ramcache entry show

PROFILE HTTP http_cache - Ramcache Entry:

±> Host: helloworld.com URI: /objet.js

…

±> Host: helloworld.com URI: /style.css

…

bp>

-------------

[CONCLUSION]

So my conclusion, to use “Include list” as a filter to cache objects, you need to configure “Minimum & Maximum object size” to 0

=================

2°) Second issue :

=================

My second issue is related to how to set “Include list”.

[CONFIG 1]

In this example, i used the following Ram Cache configuration :

- Ramcache “Enabled”

- Maximum Cache Size “10”

- Maximum Entries “10000”

- Maximum Age “3600”

- Minimum Object Size “0”

- Maximum Object Size “0”

- URI List Include List “/*.js” & “/*.css”

- Ignore Headers “All”

- Insert Age Header “Enabled”

- Aging Rate “9”

If i execute the following requests :

- GET /index.php

- GET /index.php?page=js&value=john

The BIG-IP caches well “objet.js” and “style.css”, but also “index.php?page=js&value=john” what it’s not the expected behaviour.

-------------

bp>profile http http_cache ramcache entry show

PROFILE HTTP http_cache - Ramcache Entry:

±> Host: helloworld.com URI: /index.php?page=js&value=john

…

±> Host: helloworld.com URI: /objet.js

…

±> Host: helloworld.com URI: /style.css

…

bp>

-------------

[CONFIG 2]

With this configuration :

- URI List Include List “/*\.js$” & “/*\.css$”

- GET /index.php

- GET /index.php?page=js&value=john

The BIG-IP caches well “objet.js” and “style.css”, and NOT “index.php?page=js&value=john” what it’s the expected behaviour.

-------------

bp>profile http http_cache ramcache entry show

PROFILE HTTP http_cache - Ramcache Entry:

±> Host: helloworld.com URI: /objet.js

…

±> Host: helloworld.com URI: /style.css

…

bp>

-------------

[CONFIG 3]

With this configuration :

- URI List Include List “*.js” & “*.css”

- GET /index.php

- GET /index.php?page=js&value=john

- GET /index.php?page=js&value=johnjs

The BIG-IP caches well “objet.js” and “style.css”, and not “index.php?page=js&value=john” neither “index.php?page=js&value=johnjs” what it’s the expected behaviour.

-------------

bp>profile http http_cache ramcache entry show

PROFILE HTTP http_cache - Ramcache Entry:

±> Host: helloworld.com URI: /objet.js

…

±> Host: helloworld.com URI: /style.css

…

bp>

-------------

[CONCLUSION]

In my conclusion, the way BIG-IP reads “Include list” entries is different according if it starts with “/” or not.

- When “Include list” entry starts with “/” => RegEx

- When “Include list” entry doesn’t start with “/” => Pattern String (as for HTTP Class)

What do you think about my analysis ? Did you encounter these issues ?

Makes sense, // is common syntax for indicating a regex in many languages and and commands, I guess they allow this to work without a trailing slash.

When using wildcard syntax having the leading slash for these matches is superfluous anyway so I don’t think this is an issue at all.