Hello! I would like to know your opinion on the most efficient compression and caching method on the server side.
Printable View
Hello! I would like to know your opinion on the most efficient compression and caching method on the server side.
this is what i use on my site(s):
[.htaccess file in root]
obvs make sure cloudflare isn't overriding this stuff if you're using it for caching / cdn.Code:
RewriteEngine On
<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 font/woff2
AddOutputFilterByType DEFLATE font/woff
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>
<IfModule mod_expires.c>
ExpiresActive On
#ExpiresActive Off
#Images
ExpiresByType image/jpeg "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 6 months"
ExpiresByType text/javascript "access plus 6 months"
ExpiresByType application/javascript "access plus 6 months"
# Others
ExpiresByType application/pdf "access plus 1 year"
#fonts
AddType application/font-woff woff
AddType application/font-woff2 woff2
ExpiresByType application/font-woff2 "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
</IfModule>
If you can, use amazon s3. You can connect a domain using route 53. Here is a property I just launched, currently speed optimizing it even further, and will then connect my domain to it once I'm done: http://online-casino-guide.s3-websit...amazonaws.com/
Lately I use LiteSpeed Cache plugin, now it includes free QUIC CDN.
It replaced many plugins for me:
*cach
*image compression
*webp image generation
*css/js/html minify
*js defer
*cdn
*many other small things like DNS prefetch, removing wordpress EMOJI, etc
Actually, their CDN was a decition maker for me. I always try to optimize website perfectly, but no matter how fast it would be, it still will take at least 2 seconds if server is in EU, but visitor from US. But with QUIC CDN it took me just 20m to setup and now I have different servers for each part of world. As you see, test shows that almost from every country my website loads from different(closest) IP:
https://www.gpwa.org/forum/images/im...zFXM25/cdn.png
Another good option is WP-Rocket plugin, but combined with Asset Cleanup, Flying images and cloudflare. It is more complicated option, but if you know what you are doing, it can be faster than litespeed + quic.
Litespeed cache is also my option.
Extremely fast and flexible, I never thought of using another caching plugin.
I still don’t use Quic Cloud, because I haven’t had time to configure it, but it’s definitely something we’re going to do soon; I’ve heard very good things about how it works. Better than a traditional CDN.