The Cache Handler is a workaround that is designed to trick the caching system into serving the correct content. In redirect mode, the Cache Handler does the following:

  1. Checks the active currency, country and province.
  2. Calculates a unique ID based on the above data.
  3. Checks if the ID contained within the page, which is most likely coming from the cache, matches the one it calculated at step #2.
  4. If the IDs match, nothing happens. 
  5. If the IDs don't match, the Cache Handler reloads the page by adding a URL argument to it, like http://example.org?ph=<ID calculated at step #2>. This allows the correct content to be retrieved, and then cached by the caching system for the URL with the extra argument. For example:
    - http://example.org?ph=309468094235 could be the URL with content in EUR, for Germany
    - http://example.org?ph=789578489309 could be the URL with content in EUR, for France
    - http://example.org?ph=396035698376 could be the URL with content in GBP, for the United Kingdom
    - http://example.org?ph=589087097353 could be the URL with content in USD, for the United States

    These URLs should be cached separately by the caching system, each one with its content.


What could cause the page reload loop

For the above logic to work correctly, the caching system must be configured to treat URLs with different arguments as different pages. That is, the URLs listed above, like http://example.org?ph=3094680942357 and http://example.org?ph=396035698376 have the "ph=<ID>" argument added by the Cache Handler. These URLs have be treated as different pages, and cached separately. 


If the caching system is configured to ignore the URL arguments, both http://example.org?ph=396035698376 and http://example.org?ph=3094680942357 are interpreted as just http://example.org. This results in the same content being served after a page reload, regardless of the "ph" argument. Since the cache content contains the wrong ID, the Cache Handler requests the correct content again, but gets back the same, incorrect cached page. This causes a reload loop.


How to fix the page reload loop

Fixing the page reload loop is usually just a matter of ensuring that the caching system takes into account the URL arguments when caching content. If you are using a service like CloudFlare, the caching level should be set to Standard (see What are Cloudflare's caching levels?). If you use another caching system, you can contact your service provider to configure it for you.



You can purchase the Aelia products from our online shop.