Custom Hotspot Server - Cache Control and Expires Headers

Hi,

I’m struggling to optimise caching for our custom Hotspot code. MikroTik web server variables allow changing the Cache Control and Expires header options for the HTML pages, but any JavaScript, CSS, Images, Icons etc. loaded from that page have default options which prevent caching.

The following code works fine for the page it is installed in, but not content that page loads:-

$(if http-header == "Expires")Thu, 31 Dec 2037 23:59:59 GMT$(endif)
$(if http-header == "Cache-Control")max-age=172800$(endif)

Don’t look too closely at the time values here, I’m just experimenting to see what works :slight_smile:

Does MikroTik Hotspot Web Server support Apache style .htaccess files or any other similar method to enable Server Reponse Headers to be manipulated?

In the past our pages have been pretty simple, but I’m trying to implement JQuery Mobile and preformance is becoming an issue without proper caching.

I can serve all the static content from a “Cloud” Server, Apache2 has really good cache control features allowing different values to be given to different files types. However, if for some reason the Internet connection or Server is unavailable, then the basic pages on the MikroTik Hotspot router will either fail to load at all or will likely render incorrectly due to some files being missing.

Has anyone found the trick to solving this issue on the MikroTik Router? We have nearly 300 of these routers deployed so using different hardware to get the advantages of Apache isn’t really a cost effective option.

Any help solving this would be most appreciated.

Regards

CM

Hi, I’m facing the same issue.

Did you manage to solve it?
Thanks

Any external server would require internet access, and hotspot prevents internet access. IMO, it’s not worth the effort to cache hotspot page content, because users are supposed to get out of it as soon as possible and rarely see it.

If you insist on caching it though, an external server is the way to go, BUT it should be one that you add to a walled garden, i.e. allow access to it even without a hotspot login. Maybe that was the original problem?