Author Topic: Mod_expires  (Read 6843 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Mod_expires
« on: April 19, 2016, 01:07:27 AM »
Hi all, this is my first time use centos web panel i want ask something regarding mod_expires, how i can enable it ? thanks before.
im already try this tips http://forum.centos-webpanel.com/informations/activating-gzip-mod_deflate-and-enabling-caching-on-apache/
but my site on gtmetrix still show expires header and leverage, im already check if my .httaccess is fine. so after i read and try to find it maybe its related with mod_expires. thanks before.

Offline
*****
Re: Mod_expires
« Reply #1 on: April 19, 2016, 03:52:41 AM »
add this lines to htaccess and remove any previous lines for deflate and leverage
Code: [Select]
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 month"
</IfModule>
## EXPIRES CACHING ##
<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>

Offline
*
Re: Mod_expires
« Reply #2 on: April 19, 2016, 02:02:49 PM »
thanks but my .httacces already like that. its 8 files and also get note expiration not specified.

Offline
*****
Re: Mod_expires
« Reply #3 on: April 19, 2016, 03:00:17 PM »
if you want better suggestion please post your home page url

Offline
*
Re: Mod_expires
« Reply #4 on: April 20, 2016, 12:51:38 AM »

Offline
*****
Re: Mod_expires
« Reply #5 on: April 21, 2016, 04:15:43 AM »
did you tried to installed nginx as a reverse proxy? Nginx will increase the scores.

Offline
*
Re: Mod_expires
« Reply #6 on: April 23, 2016, 02:31:56 AM »
ok thank you i will try now.

Offline
*
Re: Mod_expires
« Reply #7 on: April 30, 2016, 02:04:56 AM »
im try nginx as reverse proxy, but still fail. but its solve now, just go to rebuild apache and choose apache 2.2.31 after that click next and dont forget put --enable-expires
--enable-headers
--enable-proxy
in additional configuration then start compiler and waiting. if done rebuild your vhost and nginx. and solved my headcaches about leverage browser caching and expires header.

Offline
*
Re: Mod_expires
« Reply #8 on: July 16, 2018, 09:46:07 AM »
My server is Apache & Varnish Cache & Nginx Reverse Proxy ([Varnish Conf])

HTTP: Nginx (80) --> Varnish (82) --> Apache (8181)
HTTPS: Nginx (443) --> Varnish (82) --> Apache (8181)

My host only have opened port 80 and 443. 82 and 8181 are closed, i dont get any error, but cant cache point never pass any site test. (i already have mod_expires on htaccess)

Should need opened port 82 and 8181?

Thanks

Offline
*
Re: Mod_expires
« Reply #9 on: July 17, 2018, 01:49:24 PM »
no, you only need to have open ports 80 and 443, for testing you can open others and then close once you are done with the testing.
Try to change if you have issues and then return back.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.