1
votes

Enable compression

Compressing resources with gzip or deflate can reduce the number of bytes sent over the network.

Google Pagespeed gives me the above recommendation for making my website load faster. I'd love to do this, but I'm not sure how I go about doing it. Do I locally compress the files then upload those? Or is it a server-side thing?

If so, am I still able to edit the files easily? Or is it in compressed jargon?

2

2 Answers

1
votes

It is a server-side compression. Please read online more about gzip compression, so you can understand it properly. It uses your server resources, so not in all cases is it recommended.

This can be done with .htaccess easily. You can read about enabling it on an Apache server here: http://www.techiepark.com/tutorials/how-to-enable-gzip-compression-in-apache-server-to-speed-up-website/

Best way to do this is to contact your server administrator. They can also have good advice concerning your server setup & site resource usage.

0
votes

Nothing will be changed in your files, but if you'll enable compression on a server side, your server will compress its output before sending it to client (usually browser of some person). That will low the traffic between server and client and, because of that, speed of your site will increase.

More information is here.

One should also take into account that web server will spent additional time and CPU resources to compress the output. While usually it is small overhead, it can be the cause of potential bottleneck if number of clients is large enough.

If you are using php, you can compress the output using ob_start() by setting ob_gzhandler() callback function:

<?php
    ob_start("ob_gzhandler");
?>
<html>
    <body>
        <p>This should be a compressed page.</p>
    </body>
</html>

Alternatively, you can enable mod_deflate and let Apache web server to compress the output itself.