Template caching

Custom template pages can be cached on devices with sufficiently large memory (such as Public Spot gateways). Caching improves the performance of the Public Spot module especially for larger scenarios where the device internally caches the templates and the HTML pages generated from them.

Caching is possible for:

Templates on external servers, which are referenced by means of template variables, are not cached by the device.

Enabling template caching

You enable template caching in LANconfig by navigating to Public Spot > Server > Page table > <Name of the template> and checking the option Cache page.

In the Setup menu, you will find the corresponding parameter under Public Spot module > Page table > Template cache.

Flush template cache

The device automatically deletes and/or updates the templates stored in the cache once a new template file is uploaded to the file system of your device (local storage) or upon expiry of the cache time for an HTTP(S) template (storage on an external server). For this purpose, the device evaluates the Cache-Control header of an HTTP(S) template to discover the maximum cache time.

Important: If no cache control header is set, the page is not cached and will be discarded. When setting up your custom templates, ensure to set an appropriate meta tag and give it a reasonable cache time (in seconds); for example <meta http-equiv="cache-control" content="max-age=60">. The optimum cache time depends on the scenario. There is no specific recommendation.

You can also manually delete the template cache by using an action. Do this, start the action Flush template cache in the status menu under Public Spot.