Community discussions

MikroTik App
 
cmacneill
Member Candidate
Member Candidate
Topic Author
Posts: 293
Joined: Sun Apr 01, 2007 10:51 pm
Location: Christchurch, New Zealand

Custom Hotspot Server - Cache Control and Expires Headers

Mon Sep 16, 2013 9:43 am

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 :)

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
 
gnalbandian
just joined
Posts: 9
Joined: Fri Jul 04, 2014 9:09 pm

Re: Custom Hotspot Server - Cache Control and Expires Headers

Tue Oct 09, 2018 1:07 am

Hi, I'm facing the same issue.

Did you manage to solve it?
Thanks
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Custom Hotspot Server - Cache Control and Expires Headers

Tue Oct 09, 2018 9:40 am

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?

Who is online

Users browsing this forum: hoggins, litogorospe and 102 guests