Loading ...

Would you like to discuss your environment with a knowledgable engineer?

Preferred communication *

Thank you. We will be in touch with you shortly

aiScaler basic configuration


  1. 1 aiScaler config – basics
  2. 2 Simple test to see if aiScaler is running
  3. 3 Configuring POST request caching

aiScaler config – basics

First of all, you’d need to set website name. Open /etc/aicache/aicache.cfg and find “website” section in the example configuration file and edit it. For example:

# Section header
hostname aiscaler.com # Main host name
cname www.aiscaler.com # Alternative name (exact match)
wildcard amazonaws.com
# Process all requests made to *amazonaws.com

For sites that can not be matched to any of hostname, cname or wildcard values in configuration file, aiScaler returns error “409 Webiste not found”.
Next you need to set caching rules. Effectively, you tell aiScaler that when a request’s URL matches a string, then the response could be cached for certain amount of time. Match could be exact, partial or regular expression-based. Regexp patterns are most powerful pattern matching mechanism. Few quick examples:

pattern \.php regexp 1m # cache for 1 minute, cache dynamic files with caution
pattern .css simple 7d no_log # cache for a week, do not log in acces log file

Origins are your primary application servers, which aiScaler accelerates. You must add at least one.

origin 80 # Google server as testing origin, replace it with your server
For more configuration options see aiScaler Administrator Guide.

Simple test to see if aiScaler is running

Point your browser to the address of your server and add /aiscalerhelp, for example ipadres/aiscalerhelp or -for AWS servers- xx-xx-xx-xx-xxx.compute-1.amazonaws.com/aiscalerhelp. If aiScaler has started correctly, you should see an HTML page, displaying a “help reference”. After you have changed the settings at your DNS provider, this should work for your domain name too, for example: http://www.cnbc.com/aiscalerhelp or http://www.woot.com/aicachehelp (aicache for older versions)

Configuring POST request caching

aiScaler allows to cache POST requests just the same way as GETs, although you must be extra careful not to allow caching of private information.
If you need to cache POST requests, you can use either:

pattern \.html$ regexp 1m
request_type post  ## only post caching


pattern \.html$ regexp 1m
request_type both ## post and get caching

For a POST request to be cacheable, the following criteria must be satisfied:

  • Request’s URL must match a pattern that has request_type set to post or both
  • The matching pattern’s TTL must be non-zero
  • The POST’s body, if any, must be under max_post_sig_size limit
  • Cache-busting Cookie, if any are configured, must not be present in the request
  • Authorization header must be absent

Then it’s also important to define your content type header. To distinguish various POST requests “Content-Type: application/x-www-form-urlencoded” header must be present along with “param1=value1&param2=value2..” name/value pairs in the body . Alternatively, MD5 hashing  could be run on POST body to create a signature and then appended to URL. ie. /post.php?md5sig=8767864ADFC34678565

Full configuration example with DoS protection, SSL and caching


US 1 (408) 744-6078   EU +44 20 7993 4587