Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Caching image on external captive portal page

    Scheduled Pinned Locked Moved Captive Portal
    5 Posts 3 Posters 3.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Mypfsense2016
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by

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

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • M
          Mypfsense2016
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • GertjanG
            Gertjan
            last edited by

            @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 ….

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            • E
              exofio
              last edited by

              i uploaded the file to var/db/... what code will i use to call it on html file?

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.