I just uploaded a small HTML5 site to my server, that uses a bunch of CSS and js. Google webmaster tools is telling me to use Deflate to save 75% bandwidth. I get the concept and have seen a bunch of articles on configuring Apache (my host will do that part), but nothing explains what to do w/the content.
Do I Gzip and upload with something like WinRar or must it be done on the server via command line (yuck)? What else do I have to do or know for the content part? Is there a good tutorial anywhere for the content part?
It’s actually pretty straightforward, and only requires a couple of lines added to you .htaccess file.
Provided you (or your host) have mod_deflate enabled on the server, the following lines in your .htaccess file will compress any HTML, PHP, CSS or JS files:
Once I have the support people configure Apache to run Deflate, all I have to do is add those 3 lines at the bottom of my .htaccess file and the server will know what to do?
Also, that means I can keep uploading updated js or CSS files as normal and not even think about updating anything else and the compression will happen automagically (upon serving content to a browser) for me?
If you’re on shared hosting, you’ll probably find mod_deflate is already enabled; I’ve never had a shared host where it wasn’t.
Once you’ve added the lines to your file, you can check if it’s working by using REDbot (https://redbot.org/), or the Web Developer Toolbar will show you the information under “Document Size”.
[quote=“syakoban, post:3, topic:202104”]
Also, that means I can keep uploading updated js or CSS files as normal and not even think about updating anything else and the compression will happen automagically (upon serving content to a browser) for me?
[/quote]Yes. Any files with the extensions .css, .html, .js or .php will be compressed when served.