ExpiresByType

  • 576
Discussions
Added a discussion  to  , ExpiresByType

Hello UNA team,

I tried with both servers but the browsers are downloading the pictures each time.
For my site the timeline downloads 17 MBs each time thats too much!

Even at una.io most of the images are not browser cached.

with apache the conf is:

mod expires is enabled

ExpiresActive on
ExpiresDefault "access plus 3 seconds"
text/html "access plus 60 minutes"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpg "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType image/svg+xml "access plus 1 months"
ExpiresByType text/js "access plus 1 months"
ExpiresByType text/css "access plus 1 months"
ExpiresByType text/woff2 "access plus 1 months"
ExpiresByType application/x-shockwave-flash "access plus 30 days"
ExpiresByType text/javascript "access plus 30 days"
ExpiresByType application/javascript "access plus 30 days"
ExpiresByType application/x-javascript "access plus 30 days"
ExpiresByType application/x-gzip "access plus 30 days"
ExpiresByType image/x-icon "access plus 30 days"
ExpiresByType image/vnd.microsoft.icon "access plus 30 days"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType application/font-sfnt "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"


with nginx the conf is:
 location ~* \.(pdf|jpg|jpeg|gif|css|png|js|ico|svg|woff)$ {
    expires 30d;
 access_log off;
 add_header Cache-Control "public";
  }

  • 1876
    • Understood, but my UNA is installed in the root folder. Something wrong with caching?

      I would suggest to check Nginx access and error logs to find the reason of the problem.

      There was no error posted, just a 404 in the access log.

      If I just change

      try_files \$uri =404;

      to

      try_files $uri =404;

      It works fine after that.

      Is that ok?

      0 0 0 0 0 0
      • Understood, but my UNA is installed in the root folder. Something wrong with caching?

        I would suggest to check Nginx access and error logs to find the reason of the problem.

        There was no error posted, just a 404 in the access log.

        If I just change

        try_files \$uri =404;

        to

        try_files $uri =404;

        It works fine after that.

        Is that ok?

        I just realized that within this thread, you don't mention putting a "\" in front of "$uri".

        However, I copied over the code from here, initially, and it is there - that was what was causing the issue.

        https://una.io/page/view-discussion?id=760

        All solved now, thanks.

        0 0 0 0 0 0
        • I just realized that within this thread, you don't mention putting a "\" in front of "$uri".

          However, I copied over the code from here, initially, and it is there - that was what was causing the issue.

          https://una.io/page/view-discussion?id=760

          Thank you, I've corrected the code there.

          0 0 0 0 0 0
          Not logged in users can't 'Comments Post'.
          Followers
          Empty

          UNA - Network Infrastructure for Communities

          Close