Loading ...

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

Preferred communication *

Thank you. We will be in touch with you shortly

Webshop full page cache

aiScaler supports caching of dynamic sites such as webshops and popular CMSs like Magento and WooCommerce will work out of the box when using our templates available from the deployment tool. But what if you have a custom-written solution? This guide will show you how to manually configure caching while preserving the full site functionality.

1. Add basic caching directives to your aiScaler configuration

nano /etc/aicache/aicache.cfg

remove all patterns and add the following two instead:

pattern / simple -1800 # cache for 30m on aiScaler, but do not cache in browser

pattern (?i)\.(js|css|jpg|png|gif)$ regexp 7d no_log

2. Open your site and remove the cookies associated with it in your browser.

Internet Explorer

3. Reload the page and make sure no application-related cookies were set (like ASP.NET_SessionId or PHPSESSID).

If it is not the case, you probably have a POST request on the page. In most cases it is only necessary on pages like add-to-cart, checkout and login, so try removing it elsewhere to allow caching.

4. Go to a product page and press “add to cart”.

A POST request should be made and a cookie should be set. Note yourself its name.

5. Prevent caching when application cookie is present


pattern / simple -1800


0ttl_cookie <name_of_the_cookie>

Full pattern section example:

pattern / simple -1800 # cache for 30m on aiScaler, but do not cache in browser
0ttl_cookie ASP.NET_SessionId
0ttl_cookie userid # another cookie

pattern (?i)\.(js|css|jpg|png|gif)$ regexp 7d no_log
US (208) 948-9786‬   EU ‭+31 621302365