Showing results for 
Search instead for 
Did you mean: 

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 :

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