######################################################################################################### # aiCache Configuration file template for RightScale##########################################################################################################server # DON'T REMOVE OR MODIFY THIS LINE#server_ip * # DEFAULT: we listen on all IPs/NICs defined on this hostserver_port 80 # DEFAULT: we run on default HTTP port 80if_name eth0 # MUST POINT TO VALID Interface name that you used to obtain the licenseusername aicache # Will run as this user, must be a valid usergroupname aicache # Will run as this group, must be a valid grouplogdirectory /var/log/aicache # Log directory: access, error, stats, snmp.stat go therestay_up_on_write_error # When set, server will continue to service requests even when it runs # out of space in log partition (directory).drop_user_agent # Do not log user-agent informationlog_healthcheck # Will log health check requestslogstats # Log global statisticsmax_log_file_size 100000000 # Auto-rotate logs when it grows above 100 Mbmaxkeepalivereq 20 # Max # of keep-alive requests per client keep-alive connectionmaxkeepalivetime 10 # Max lifespan of client keep-alive connection, secondsmaxclientidletime 4 # Max idle time of client keep-alive connection, secondsmaxosidletime 4 # Origin Server connection max idle timesnmp_stat_interval 4 # SNMP stats refresh interval, secondsmax_os_ka_conn 2 # Max number of origin server keep-alive connections, per origin servermax_os_ka_req 20 # Max number of origin server requests per os keep-alive connection# Alertsalert_req_sec_max 2500 # Max number of requests per second, more will generate alertalert_req_sec_min 0 # Min number of requests per second, less will generate alertalert_bad_resp_sec 2 # Max bad responses (404, 500, etc...) from origin servers per secondalert_os_rt 200 # Alert on origin response time (miliseconds) alert_dir /usr/local/aicache/alerts # Required for rightscale alertsalert_email root@localhost # Requered for rightscale alerts# Uncomment following lines if you want to use aiCache to block DDOS attack#clip_throttle # Enable clip throttle#block_ip_interval 10#block_ip_max_req 100#silent_block_ip########################################################################################################## Website##########################################################################################################website # DON'T REMOVE OR MODIFY THIS LINE#hostname magentoshop.domain.com min_gzip_size 4000 # Will compress compressible responses over 4000 bytes in sizefallback # Will fall back to prev cached response if new one can not be obtainedlogstats # Will log basic website stats to a dedicated stats log filehealthcheck /test.html HTTP 5 4 # Will request /test.html every 5 seconds, match response to "HTTP", timeout 4 secondsforward_os_cache_headers # Pass on cache headers, so clients don't cache what shouldn't be cached########################################################################################################## HTTP Headers. Do not modify without a very good reason.#########################################################################################################httpheaderder Connection keep-alivehttpheader Accept */*httpheader Accept-Encoding gzip########################################################################################################## Patterns: this is what sets up Time-to-Live (caching rules)########################################################################################################## Early warning cookie, once we enter into user personal stuff (cart, comparisons, log in)0ttl_url /catalog/product_compare0ttl_url /checkout0ttl_url /customer/accountpattern .ico simple 7d no_log # cache for a week, do not log in acces log filepattern .js simple 7d no_log # cache for a week, do not log in acces log filepattern .css simple 7d no_log # cache for a week, do not log in acces log filepattern .jpg simple 7d no_log # cache for a week, do not log in acces log filepattern .gif simple 7d no_log # cache for a week, do not log in acces log filepattern .png simple 7d no_log # cache for a week, do not log in acces log filepattern .woff simple 7d no_log # cache for a week, do not log in acces log filepattern ^/index.php/admin regexp 0 # admin pages not cacheablepattern ^/checkout regexp 0 # checkout module pages not cacheablepattern ^/customer regexp 0 # customer module pages not cacheablepattern ^/catalog/product_compare regexp 0 # product compare featurepattern ^/content regexp 30m # content pages (articles)# All other content is cached for 30 minutes unless it carries some specific cookiespattern / simple 30m0ttl_cookie CUSTOMER # Will have this once a visitor is logged in0ttl_cookie CART # Will have this once a visitor has started adding things to the cart0ttl_cookie NEWMESSAGE # Notifications to user (i.e. product inserted in cart)0ttl_cookie COMPARE # Will have this once a visitor has started comparing products0ttl_cookie nocache # Magento provides this hint (in some cases)0ttl_cookie aicache0ttlcookie # If the user has started using any of the personalized functions########################################################################################################## Origins. At least one must be defined#########################################################################################################origin 192.168.1.1 80The most important bits here are: forward_os_cache_headers # Pass on cache headers, so clients don't cache what shouldn't be cachedThis forwards Magento generated cache headers onto the client. These headers avoid the user browser to cache pages which later on may be updated (i.e. as the user adds items into the cart) 0ttl_url /catalog/product_compare0ttl_url /checkout0ttl_url /customer/accountWhen the user first visits any of the previous URLs, a cookie is forward to his browser. Later on we check for such cookie in the pattern section pattern .ico simple 7d no_log # cache for a week, do not log in acces log filepattern .js simple 7d no_log # cache for a week, do not log in acces log filepattern .css simple 7d no_log # cache for a week, do not log in acces log filepattern .jpg simple 7d no_log # cache for a week, do not log in acces log filepattern .gif simple 7d no_log # cache for a week, do not log in acces log filepattern .png simple 7d no_log # cache for a week, do not log in acces log filepattern .woff simple 7d no_log # cache for a week, do not log in acces log fileThese patterns correspond to easily cacheable content (media, JavaScript, etc). These make the bulk of the requests, thus we check for them first. pattern ^/index.php/admin regexp 0 # admin pages not cacheablepattern ^/checkout regexp 0 # checkout module pages not cacheablepattern ^/customer regexp 0 # customer module pages not cacheablepattern ^/catalog/product_compare regexp 0 # product compare featureThese correspond to site areas which are not cacheable at all (admin dashboard, checkout process, product comparison features, etc.) pattern ^/content regexp 30m # content pages (articles)This corresponds to the only purely cacheable HTML content, which never includes personalized info for the visitor. # All other content is cached for 30 minutes unless it carries some specific cookiespattern / simple 30m0ttl_cookie CUSTOMER # Will have this once a visitor is logged in0ttl_cookie CART # Will have this once a visitor has started adding things to the cart0ttl_cookie NEWMESSAGE # Notifications to user (i.e. product inserted in cart)0ttl_cookie COMPARE # Will have this once a visitor has started comparing products0ttl_cookie nocache # Magento provides this hint (in some cases)0ttl_cookie aicache0ttlcookie # Caching busted by ourselves |