If you are using this webserver for your website, you just need to add the following command to your nf file. Enable GZIP Compression on NGINX for WordPress # Remove browser bugs (only needed for really old browsers)īrowserMatch ^Mozilla/4 gzip-only-text/htmlīrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Compress HTML, CSS, JavaScript, Text, XML and fontsĪddOutputFilterByType DEFLATE application/javascriptĪddOutputFilterByType DEFLATE application/rss+xmlĪddOutputFilterByType DEFLATE application/vnd.ms-fontobjectĪddOutputFilterByType DEFLATE application/x-fontĪddOutputFilterByType DEFLATE application/x-font-opentypeĪddOutputFilterByType DEFLATE application/x-font-otfĪddOutputFilterByType DEFLATE application/x-font-truetypeĪddOutputFilterByType DEFLATE application/x-font-ttfĪddOutputFilterByType DEFLATE application/x-javascriptĪddOutputFilterByType DEFLATE application/xhtml+xmlĪddOutputFilterByType DEFLATE application/xmlĪddOutputFilterByType DEFLATE font/opentypeĪddOutputFilterByType DEFLATE image/svg+xmlĪddOutputFilterByType DEFLATE image/x-iconĪddOutputFilterByType DEFLATE text/javascript Now all you need to do is check your website with GZIP online compression tool to make sure GZIP is enabled on your website or not. Then, upload the edited version to your server.Ĭopy and paste the code below between your beginning and ending WordPress tag.įinally, save the file and upload it back to your server. To prevent any mistakes, you have to edit them on your computer. htaccess file and download it to your computer. But we recommend using an FTP client to access it. Although, you can access it from your cPanel. The best way to access this file is via an FTP client. htaccess file can be found in your website’s root directory. So, we highly recommend getting a backup of your WordPress website before editing your. Therefore, if you make a mistake, your website may break. Because you are directly editing your WordPress core file. htaccess file and add GZIP to it.Īlthough, this method could be a bit risky. One of the basic ways of enabling GZIP in WordPress is by adding it to your. How to Enable GZIP Compression for WordPress?Īs we mentioned, enabling GZIP compression in WordPress is This is why you may see an error using Google Page Speed tools. If this type of compression is enabled on a website, the files are displayed with smaller data and if the website is not using the GZIP compression, the files are displayed with the original size and it may take a while for the entire website to load. When a browser visits a website, it checks if GZIP compression is enabled on the website or not. Ilya Grigorik defines compression as the process of encoding information by fewer bytes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |