Caching image on external captive portal page



  • Hi all,
    I still use pfsense 2.1.3. I know it's old but that what we need to accept for now.
    I have a captive portal which points to a dynamic page A.
    Actually, we want to speed up the captive portal for around 100 concurrent users.
    So we think the image may be the culprit.
    => Is there any way we can cache the images on the dynamic page A?

    Squid seems not helping as I believe we need to pass through captive portal before squids can start caching.

    Thanks a lot.



  • What do you mean with "dynamic page A." ?

    Squid seems not helping as I believe we need to pass through captive portal before squids can start caching.

    Euh ….. the captive portal is, when a user is authenticated, just a firewall rule. This means a xx micro second delay.
    If the user isn't authenticated, the login page is showed - the image is on that page ? What about storing the image on pfSense ? Faster then that won't be possible (except : making the image smaller in weight).

    Another option might be : apply the easy solution : use a recent pfSense version ;)



  • My captive page is dynamic with dynamic images.
    So I can't store the image locally in pfsense.

    That's why I want to know any way the pfsense could cache these images.



  • @Mypfsense2016:

    My captive page is dynamic with dynamic images.
    So I can't store the image locally in pfsense.

    That's why I want to know any way the pfsense could cache these images.

    By nature, dynamic images shouldn't be cached. Otherwise they wouldn't be dynamic anymore.
    You could add a line to the .htaccess (pfSense portal web server) file that images (or just THAT image) should be sached in the users browser xx seconds, minutes or even hours.
    You could also 'upload' the image to the the pfsense folder "/var/db/cpelements", that's where the uploaded files for the captive portal page are stored.
    Or : with some code (wget, a cron, etc) have pfSense get the image refreshed every x time locally.

    It's all up to you ….