Forum Discussion

Naman_65674's avatar
Naman_65674
Icon for Nimbostratus rankNimbostratus
Aug 25, 2009

RAM Cache- Serving expired content when pool is down

Hi,

We currently have a HTTP profile which caches content going to a certain URI. If the pool is down and the content is still "fresh" in the cache then the requests are served fine, but if the pool is down and the cache is expired, the requests obviously fail.

My question is whether you could (via an iRule) serve expired cache content if the pool is down:

 
 when HTTP_REQUEST { 
    . 
    . 
    if { [active_members $pool] equals 0 } { 
       //Serve from expired cache?? 
    } 
    . 
    . 
 

Thanks,

Naman
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Naman,

     

     

    Is all (or even most) of the site content cacheable? If not, I'm not sure there is much use in trying to serve the cached content if the dynamic content can't be served.

     

     

    That said, if you set a very long expire time in the HTTP profile you could handle the expiration in an iRule using CACHE::age and CACHE::expire (Click here). If the pool is up, you could expire the content using the same time expiry you have set in the profile now. If the pool is down, you could not expire the cache content.

     

     

    Aaron