CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Problem this snippet solves:

Requests for various image files go to one pool, pdf's to another, and everything else to a default pool. Example of using switch with a shared script body for multiple options. (The "-" means to execute the next script body if this condition matches.)

Code :

when HTTP_REQUEST {
  # Check the requested path (URI minus the query string)
  switch -glob [HTTP::path] {
    "*.jpg"-
    "*.gif"-
    "*.png"{ pool image_pool }
    "*.pdf"{ pool pdf_pool }
    default{ pool web_pool }
  }
}
Version history
Last update:
‎18-Mar-2015 14:07
Updated by:
Contributors