Optimization Shopware's web performance with wao.io usually works out of the box without the need for any special configuration.
- Everything is working fine (and much faster now) with wao.io !
- Check: do my statistics still show the correct number of visitors?
There might be some gotcha's if your shop tracks unique visitors based on their IP addresses, or if your switch a shop into maintenance mode. Both tracking and access control are often based on the client's IP address. As soon as the optimized traffic is routed via wao's infractructure, the backend could misunderstand this infrastructure as only one single client accessing the store.
The simple solution is to allow the backend server to use another parameter, usually the HTTP-Header "X-Forwarded-For" which contains the original client's IP address.
Most shops and CMS backends will do this automatically, but for security reasons, some systems will only use this information when it comes from a trusted server which you have explicitly allowed in your configuration.
trustedproxies configuration defines which clients (proxies) are allowed to set the
HTTP_X_FORWARDED_FOR header. Headers from other IPs are ignored."
The simple solution: set wao.io as a trusted proxy in your Shopware's config.php:
'trustedProxies' => array(
Depending on your specific Shopware setup and PHP version, you might need to use a different syntax to describe the same configuration, for example:
$config['trustedProxies'] = ['220.127.116.11','18.104.22.168','22.214.171.124','126.96.36.199'];
For more details, see:
In symfony-based frameworks other than Shopware, you would probably use symfony's
setTrustedProxies function like this:
This is no specific issue with wao.io and Shopware, but more generally, with any software based on symfony.com (Drupal, Joomla, Contao, PrestaShop, etc.) and used behind a reverse proxy or load balancer infrastructure like wao.io, Varnish cache, or Elastic Load Balancing in Amazon's AWS.
This articles explains what is going on:
- How to Configure Symfony to Work behind a Load Balancer or a Reverse Proxy http://symfony.com/doc/current/deployment/proxies.htm