cache directives question using proxy

leonep

Well-Known Member
Nov 18, 2014
229
18
68
Pescara
cPanel Access Level
Root Administrator
Hi,
on apache include editor some years ago i add this directives for cache:


<filesMatch ".(css|jpg|jpeg|png|gif|webp|xml|js|ico)$">
Header set Cache-Control: "max-age=31536000, public"
</filesMatch>
<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
# CSS, JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
# Others
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
</IfModule>


when I installed the nginx proxy I was wondering if it is still necessary to keep these directives on apache or if it is better to put them in nginx.
thanks for info
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,252
2,219
363
cPanel Access Level
Root Administrator
cPanel's nginx implementations proxies all traffic to Apache, so you're fine to leave those in place. For a true test if nginx is providing you with performance improvements, I would try removing those and seeing how nginx behaves, and then adding them back and seeing if you can tell a difference.
 

leonep

Well-Known Member
Nov 18, 2014
229
18
68
Pescara
cPanel Access Level
Root Administrator
it works well
i only want to know if i need to use also apache mod_cache and apache mod_cache_disk if i am using nginx cache.....
can i have benefits from both ???
i use my server for basic cms hosting
thanks