This is one easy way to reduce server cost, but even for smaller Websites, it does make a significant difference in page size, it’s one of the easiest ways to Optimize Your Site.
So really, there are no good excuses not to do it. So, what is it exactly? Html Compression is a technique that we all know from archiving files and directories with archive compression programs like WinZip, WinRAR, 7zip and others. What HTML Compression does basically is it takes your HTML code, looks for similar strings within it and replaces them with shorter strings, Resulting in less code and therefore smaller file size. No, but this is not the same thing as Minification, Though that’s a fine method as well.
If that’s, what you’re into Minification is the process of eliminating all the spaces, the line, breaks, Empty lines, indentation and so on within your code, that makes it easier for humans to read and work with. Non-Humans don’t need all this buffers to visualize the contents of the code So with Minification we can trim all that fat Which results in a slightly smaller file size, That’s well and good. And yes, this will translate into less bandwidth requirements to deliver your code from a Server and deliver to someone’s Browser.
But compression goes that one step further. It searches for the similar strings, like I just mentioned, and replaces them with shorter references resulting in much less code. For example, let’s say I’ve got all these Closing div tags. After a certain section on my web page, There is 12 of these with greater than and less than signs The slashes, the d’s, the i’s the v’s.
But don’t worry this not something that you have to do manually, so don’t get rattled here, I’m just showing you how the process works. Minification will do this, or compression will look at that and say Actually, instead of seeing this as 72 characters let’s look at this as 6 characters repeated 12 times. We got these first 6 characters, the greater than sign The slash D I V And a less than sign.
We’Ll keep this as our reference And make a second reference to the first symbol, starting 6 characters back And will say: let’s use the next 6 characters from there. So now we’ve got our first closing div and our second closing div, Since the next 10 closing div.’s are the exact same. We can make this refer to the next 60 characters And, while all What started as a 72 character, uncompressed in their original form Can now be represented by just 14 Characters in total compressed format.
So that’s the basic idea If we apply this to our entire page, with all the div tags and all the tags like body, paragraph images lines and so on, As well as herb’s, all our Style classes and so on… Our uncompressed web page. That clocks in at a 167mb, comes down to a lean and mean 78mb once compressed A whopping 46 % reduction in file size, Rock and Roll. Then, when a user requests our content, our server sends that smaller compressed code
The User receives it, their browser, decompresses it and boom they’ve got our content So yeah. This last action does take time in CPU, but in almost all cases it takes much less time than transferring your HTML content in the larger uncompressed format. So that’s how it works again, don’t need to sleep over these details. You don’t need to mess with your code or know how to write Algorithms to make this work. All that is taken care of the most common HTML compression methods are DEFLATE and GZIP And honestly, there is not a gigantic difference between them.
They both use the same compression method, The same Algorithms, But GZIP also contains a checksum and a header footer. So, DEFLATE is technically faster, but you also technically risk both the payloads, since there is no checksum Anyway go ahead and research. This more. If you like it’s worth your time, but in my opinion, to make your tomorrow in my case, I use GZIP because its good enough and it’s on the side of safety in terms of delivering content Now to implement either of them is pretty simple. It just depends on what kind of server you are running, or you have an .htaccess file. If you get an htaccess file, simply edit it and add this Deflate codes to it or for GZIP. Add this GZIP codes.
Save and Done Get back crack those methods and waste. Those hearing behind your head, Your HTML, is now compressed And user is requesting. Your content will automatically receive that compressed content Which will decompress in your browsers. If you’re running on NGINX yo want to add it to your NGINX config file, Add the following: Save Close and restart the Server and on Windows server.
It’s even easier. You can just open up your IIS manager, click on the siting, question Click compression And enable STATIC COMPRESSION And for WordPress users, it’s still best to add it to your .htaccess file directly, like I showed it to you a minute ago, But WordPress also has a Built-in Gzip compression In your option, which leverages PHP Again it’s better to do it through your .htaccess file but Hey if it’s too daunting. For some reason, then this method also works and when you’re done, assuming you have a GZIP, you can Google GZIP compression Tool And test your webpages to make sure it’s working feel free to check out our other videos. So you can keep fine-tuning and getting the most out of your SEO and click subscribe to stay, updated with new tips and tricks to get you to the top of the search engine results pages.
Faceless AI Business Empire
https://warriorplus.com/o2/a/qq2nxyv/0
Easy Pro Funnels V2
https://warriorplus.com/o2/a/c4qmt/0
Instant access to your free swipe file of 47 business-boosting tools
Discover more from Automatically generating your monthly income?
Subscribe to get the latest posts sent to your email.