Forum Discussion

Frank_Mancini_3's avatar
Frank_Mancini_3
Icon for Nimbostratus rankNimbostratus
Feb 18, 2009

What are the steps to NOT cache a specific file?

Example: /homepage/home.html

 

 

What are the steps if I don't want to cache:

 

 

1) Just this one page

 

2) The path /homepage/*

 

3) Just this one page and all the query strings home.html?file=test

2 Replies

  • You can use HTTP::path to retrieve the requested path (URI minus the query string) and CACHE::disable to selectively disable caching for that request.

     
     when HTTP_REQUEST { 
      
         Check if path is just one page (dont_cache.html) 
        if {[HTTP::path] ends_with "dont_cache.html"}{ 
      
            Disable caching for this request 
           CACHE::disable 
        } 
     } 
     

    You can modify the check to '[HTTP::path] starts_with "/homepage/"'. If the application is not case sensitive, you can set the path to lowercase using [string tolower [HTTP::path]] when making the comparison.

    Aaron
  • While iRules are great for many things managing what WebAccelerator caches and doesn't cache is not one of them. This should be managed completely by the WebAccelerator policy. Disabling caching or WebAccelerator via an iRule for a page will result in none of the embedded content being assembled with Intelligent Browser Referencing or MultiConnect if those are enabled.

     

     

    To prevent WebAccelerator from caching an item such as an HTML page you need to do the following:

     

     

    1) Open the policy in the policy editor

     

    2) Copy the pages node and rename

     

    3) Move the newly created node up to have a higher priority than the pages node

     

    4) Edit the Path parameter and change to /homepage/home.html

     

    5) Select Assembly Rules from the drop down box

     

    6) Select Proxying Rules

     

    7) Select the Always Proxy radio button

     

    8) Save the changes

     

    9) Publish the policy

     

     

    This will achieve items 1 & 3 no need to specify the individual query parameters as long as the path matches WebAccelerator will always proxy those requests to the origin servers.

     

     

    For item 2 are these just pages within the /homepage directory or do you not want WebAccelerator to cache any content within the /homepage directory?