{"id":2060,"date":"2020-05-03T05:30:00","date_gmt":"2020-05-02T22:30:00","guid":{"rendered":"https:\/\/www.indowhiz.com\/articles\/?p=2060"},"modified":"2023-04-01T13:16:01","modified_gmt":"2023-04-01T06:16:01","slug":"terms-in-file-size-reduction","status":"publish","type":"post","link":"https:\/\/www.indowhiz.com\/articles\/en\/terms-in-file-size-reduction\/","title":{"rendered":"Terms in the File Size Reduction of a Web Page"},"content":{"rendered":"\n<p>Commonly, there are <a href=\"https:\/\/www.indowhiz.com\/articles\/en\/general-guidelines-to-improve-your-website-speed\/\" target=\"_blank\" rel=\"noreferrer noopener\">many ways to increase website speed<\/a>. One of them is to optimize the web page file size. These files such as images, CSS, Javascript, HTML, and other supporting files. The smaller the file size of a web page, the better. If you use WordPress, almost all of the optimizations in this article have generally been provided by the cache plugin.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Benefits of the file size reduction<\/h2>\n\n\n\n<p><em>Why do we need to reduce the file size?<\/em> The short answer, so that any access to web pages is much cheaper and faster.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Impact on visitors<\/h3>\n\n\n\n<p>The larger the file size of a web page, the longer the loading time on the visitor browser. Then, when the loading of your web page is more than 2-5, the visitor would leaving you. They will look for another similar website. <\/p>\n\n\n\n<p>On the other side, did you know that visitors who open any web pages will cost them internet services? Moreover, it will increase the visitor waiting time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Impact on the server<\/h3>\n\n\n\n<p>Now apart from the visitor side, the site owner also incurs costs to provide content to visitors. Every time a visitor requests a page, the site server must work to process the page, send the files, etc. So the larger the file size requested, the more work the server has to do. Even more, if visitors per day reach tens to more than hundreds of thousands, the server would reach its capacity. If the server is no longer able to handle page requests, the server specifications must be increased, and that costs a lot of money.<\/p>\n\n\n\n<p>It is also clear that the smaller the size of a web page, the faster its loading time. So it is very important to make all file sizes as small as possible.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Minification and Beautification<\/h2>\n\n\n\n<p>In the development phase of a website, the code written must be in accordance with code writing standards. This includes neatness and readability. In other words, indents, spaces, comment blocks, string documentation, etc. can be used to improve its readability. As a result, the code will be easier to understand and modify. But it makes the file size becomes larger as the code increases.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Minification<\/h3>\n\n\n\n<p>In the production or release phase of a website, the site must be able to load quickly and responsively. Generally, visitors will not care how the codes work to display a web page.<\/p>\n\n\n\n<p>Therefore, the unnecessary content in the code can be deleted, without affecting the logic or flow of the code \u2014 for example indentations, spaces, comment blocks, and documentation strings. This removing process can be called &#8220;Minification&#8221;. In addition, minification can be done by changing the name of the variable or function to be shorter.<span id=\"c4cc1ae2-97eb-4689-9726-0c38ea1e4e4e\" data-items=\"[&quot;1889752853&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[1]\u200b<\/span><\/p>\n\n\n\n<p>We could minify a web page files such as HTML, CSS, and Javascript. Many online sites can help you to minify your web page files. For example, to minify HTML, you can use <a rel=\"noreferrer noopener\" href=\"https:\/\/codebeautify.org\/htmlviewer\" target=\"_blank\">code beautify<\/a>, and to minify CSS \/ JS you can use the site <a rel=\"noreferrer noopener\" href=\"https:\/\/www.minifier.org\/\" target=\"_blank\">minifier.org<\/a>. The &#8220;<em>code beautify<\/em>&#8221; sites actually have features to minify the HTML, CSS, and Javascript.<\/p>\n\n\n\n<p>To understand minification, here is a sample code during the development phase:<span id=\"8ca18488-6a00-4d91-a2ee-c86916df80cc\" data-items=\"[&quot;3963805390&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[2]\u200b<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;html&gt;\n  &lt;head&gt;\n    &lt;style&gt;\n       \/* container class used in landing page *\/\n       .container { width: 80% }\n       .container { font-size: 104% }\n    &lt;\/style&gt;\n &lt;\/head&gt;\n\n &lt;body&gt;\n   &lt;!-- content of container : BEGIN--&gt;\n   &lt;div class=\"container\"&gt;\u2026&lt;\/div&gt;\n   &lt;!-- content of container : END--&gt;\n\n   &lt;script&gt;\n     displayAnalytics(); \/\/ conversion metric function\n   &lt;\/script&gt;\n &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>Note that the code above has three different types of content, which are HTML, CSS, and Javascript. Each type of content has different rules. Then each type of content should be minified differently. Things that done in the minification process such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It appears that comments in the code are important things in the development, but visitors will not see them. So, CSS (<code>\/ * ... * \/<\/code>), HTML (<code>&lt;! - ... -&gt;<\/code>), or JavaScript (<code>\/\/ ...<\/code>) comments can be removed, which impacts on reducing the total file size of a web page.<\/li>\n\n\n\n<li>In some case of CSS, the container class can actually be put together without changing the final result. But there are some exception when there are any overwrite rules. So, a good CSS minification application can do this, which in turn can significantly reduce CSS file sizes.<\/li>\n\n\n\n<li>In addition, whitespace (spaces and tabs) are also needed only in the development phase of HTML, CSS, and JavaScript. So we can delete it without worrying about changing the flow of the programs.<\/li>\n<\/ul>\n\n\n\n<p>So, the code above will result in shorter code, and smaller file size, after minified, as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;html&gt;&lt;head&gt;&lt;style&gt;.container{width:80%;font-size:104%}&lt;\/style&gt;&lt;\/head&gt;&lt;body&gt;&lt;div class=\"container\"&gt;\u2026&lt;\/div&gt;&lt;script&gt;displayAnalytics();\n&lt;\/script&gt;&lt;\/body&gt;&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Beautification<\/h3>\n\n\n\n<p>Beautification is the opposite of minification. It will revert the code from the minification result. It gives an indentation or whitespace to the code so that it can be read again. If the above minification code is beautified, it will be as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;html&gt;\n  &lt;head&gt;\n    &lt;style&gt;\n       .container{width: 80%; font-size: 104%}\n    &lt;\/style&gt;\n &lt;\/head&gt;\n &lt;body&gt;\n   &lt;div class=\"container\"&gt;\u2026&lt;\/div&gt;\n   &lt;script&gt;\n     displayAnalytics();\n   &lt;\/script&gt;\n &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>With beautification, the code can be easy to read again (by people other than the developer). But we can see that beautification cannot return the comments or the code removed by the minification.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Combine files<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Combine CSS and JS files<\/h3>\n\n\n\n<p>A web page generally has many CSS and Javascript files. The CSS and Javascript files need to be loaded so that the page can be rendered perfectly. However, every file that needs to be loaded, requires many process and time, which can be seen in Figure 1.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" width=\"503\" height=\"141\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/timing-for-request-file.png\" alt=\"The time taken to request a file until receive it\" class=\"wp-image-2013\"\/><figcaption class=\"wp-element-caption\">Figure 1. The example of time taken to request a file until receive it<\/figcaption><\/figure>\n\n\n\n<p>Only to get one file, the paths needed are starting from DNS resolution, connecting, managing TLS, waiting for the server, and finally receiving the file. After receiving the file, then the file could be used.<\/p>\n\n\n\n<p>Imagine what happens, if there are so many files when loading web pages. Surely visitors will wait a long time to load a web page.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/combine-CSS-JS.png\" alt=\"Combine CSS or JS files\" class=\"wp-image-2015\" width=\"400\" height=\"217\"\/><figcaption class=\"wp-element-caption\">Figure 2. Combine CSS or JS files<\/figcaption><\/figure>\n\n\n\n<p>So, by combining these files, we got many benefits. One of them is that it can reduce the number of file requests to the server.<span id=\"0e951f8d-4b90-4473-a3dd-c0bced32a2bc\" data-items=\"[&quot;1555504153&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[3]\u200b<\/span> If a page has 10 CSS and 3 JS, and combined into a CSS file and a JS file, then the requests are reduced from 13 files to only 2 files. Moreover, because the file request is reduced, it will automatically have an impact on increasing the speed in loading a web page. You can see the illustration of combining CSS and JS files Figure 2.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Do we need to combine CSS and JS files?<\/h4>\n\n\n\n<p>Whether we need to combine CSS and JS files or not, this is a long debate. Of those who disagree, they have several reasons such as:<span id=\"e16cbbb1-4e4d-4f39-8b2e-c9920dbb4513\" data-items=\"[&quot;391374714&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[4]\u200b<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Combining CSS and JS will slow down and increase the server load. Especially there is an HTTP\/2 feature, which can send many CSS and JS files at once.<\/li>\n\n\n\n<li>Combining CSS and JS sometimes will break the layout of the web pages.<\/li>\n\n\n\n<li>Add unnecessary files on several pages.<\/li>\n\n\n\n<li>Slow loading pages when the cache has not been created.<\/li>\n\n\n\n<li>etc<\/li>\n<\/ul>\n\n\n\n<p><em>Note: Simply put, HTTP\/2 is an HTTP protocol that allows the server to send many files at once before requested. However, these are files that are needed by the browser in rendering the web page.<\/em><span id=\"f3a98186-d603-4a73-a1c9-d3fb11d21ad5\" data-items=\"[&quot;4008438939&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[5]\u200b<\/span><\/p>\n\n\n\n<p>Before agreeing and disagreeing, my advice is, you need to try them out in your website. I do not guarantee that combining CSS and JS will speed up your website loading. Because on this Indowhiz website, the use of combines actually speeds up page loading.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" width=\"947\" height=\"681\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/page-loading-waterfall-result-with-combine.png\" alt=\"Loading pages by combining CSS and JS files\" class=\"wp-image-2023\"\/><figcaption class=\"wp-element-caption\">Figure 3. Loading pages by combining CSS and JS files<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" width=\"932\" height=\"959\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/page-loading-waterfall-result-NO-combine.png\" alt=\"Loading pages without combining CSS and JS files\" class=\"wp-image-2025\"\/><figcaption class=\"wp-element-caption\">Figure 4. Loading pages without combining CSS and JS files<\/figcaption><\/figure>\n\n\n\n<p>In Figure 3, an experiment is carried out by combining CSS and JS. Pay attention to files number 2 through 5, where there are only 4 CSS and JS files. <\/p>\n\n\n\n<p>On the other hand, Figure 4 shows the results of loading a page without combining CSS and JS. Note that files number 2 to 22, with a total of 20 CSS and JS files, are also sent simultaneously.<\/p>\n\n\n\n<p>Both of the experiments above already use HTTP\/2, so CSS and JS files can be sent simultaneously.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" width=\"941\" height=\"185\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/page-load-with-combine-Performance-Results-Median-Run-SpeedIndex.png\" alt=\"Average loading time by combining CSS and JS files\" class=\"wp-image-2024\"\/><figcaption class=\"wp-element-caption\">Figure 5. Average loading time by combining CSS and JS files<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/page-load-NO-combine-Performance-Results-Median-Run-SpeedIndex.png\" alt=\"Average loading time without combining CSS and JS files\" class=\"wp-image-2026\" width=\"935\" height=\"181\"\/><figcaption class=\"wp-element-caption\">Figure 6. Average loading time without combining CSS and JS files<\/figcaption><\/figure>\n\n\n\n<p>However, on this Indowhiz website, the page loading time is even faster by combining CSS and JS. Pay attention and compare between Figure 5 and Figure 6.<\/p>\n\n\n\n<p>So, the conclusion is, with a blog type like Indowhiz, where there isn&#8217;t much difference between CSS and JS on each page, combining CSS and JS is able to speed up page loading.<\/p>\n\n\n\n<p>However, it should be noted that the statement &#8220;combining CSS and JS will break the layout of the site pages&#8221; is sometimes true. Because I&#8217;ve already experienced it. Therefore, it is necessary to test one by one, when combining CSS and JS files. Any CSS and JS files that don&#8217;t work\/error after combining can be excluded.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">CSS Sprite<\/h3>\n\n\n\n<p>If you have a lot of small images such as logos, icons, buttons, etc. on a site page, CSS sprites are very important. The CSS sprite is a method that can help speed up the loading of a web page. This method combines small images, which have the same dimensions or resolution, into one large image. Then, this large image is called a <em>sprite sheet<\/em> or <em>tile set<\/em>.<span id=\"7b7d247c-8037-4adb-98b9-e0f1b2e627a8\" data-items=\"[&quot;3270003192&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[6]\u200b<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/combine-vs-non-combine-icon-images.png\" alt=\"(a) sprite sheet, (b) individual images\" class=\"wp-image-2018\" width=\"400\" height=\"159\"\/><figcaption class=\"wp-element-caption\">Figure 7. (a) <em>sprite sheet<\/em>, (b) individual images<\/figcaption><\/figure>\n\n\n\n<p>Simply put, when designing a web page, each image is stored in a file, as in Figure 7 (b). So, when visitors open a web page, then many files must be requested by the browser to the server. Eventually, this will reduce the loading speed of a web page. In contrast, if all those small images combined into a sprite sheet, as in Figure 7 (a), then the browser only requests a combined file. Later, we can select only the necessary parts.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.indowhiz.com\/articles\/wp-content\/uploads\/2020\/04\/grid-of-sprite-sheet-image.png\" alt=\"The layout and location of images on sprite sheets\" class=\"wp-image-2020\" width=\"450\" height=\"353\"\/><figcaption class=\"wp-element-caption\">Figure 8. The layout and location of images on sprite sheets<\/figcaption><\/figure>\n\n\n\n<p>When the sprite sheet has been loaded, then the part of the image that you want to display can be arranged using CSS. For example, suppose that each section in Figure 8, is <code>128 x 128<\/code> pixels. So, if you want to use an icon of a person, the CSS code is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"css\" class=\"language-css line-numbers\">background: url('icon_sprites.png');\nbackground-position: 0 0;\nwidth: 128px;\nheight: 128px;<\/code><\/pre>\n\n\n\n<p>The code above indicates that the image to be taken is <code>128 x 128<\/code> pixels. Then from the <code>icon_sprites.png<\/code> file, parts are taken from the position of 0 pixels left and 0 pixels top.<\/p>\n\n\n\n<p>Another example, if you want to take an icon of a phone, then just change to <code>background-position: 0 -128px;<\/code>. This is because we want to take pictures starting from the position of 0 pixels left and 128 pixels down. -128 pixels in computer interpretation means the image is offset padding by -128px. Other than that, if you want to take an icon of a house, then we can use <code>background-position: -128px -128px;<\/code>, and so on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. File compression<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">HTTP compression<\/h3>\n\n\n\n<p>One method to reduce the file size is using HTTP compression. Currently, there are many types of HTTP compression that can be used on a website.<span id=\"7ce555e9-09f5-4e54-aa61-6d9070c73484\" data-items=\"[&quot;4257910195&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[7]\u200b<\/span> There are gzip, deflate, compress, br (brotli), and so on.<span id=\"266aee2c-2ef4-4324-991b-5c12c883dba0\" data-items=\"[&quot;1641409244&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[8]\u200b<\/span><\/p>\n\n\n\n<p>In the web page header, this type of HTTP compression is commonly written as <em>content-encoding<\/em>. Initially, the browser sends the types of compression it supports. Generally, we can see it from the request header sent by the browser, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"markdown\" class=\"language-markdown line-numbers\">Host: www.indowhiz.com\nUser-Agent: Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0\nAccept: text\/css,*\/*;q=0.1\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate, br<\/code><\/pre>\n\n\n\n<p>From the example above, the <code>Accept-Encoding<\/code> information shows that the browser can recognize gzip, deflate, or br (brotli) compression. So, the files sent from the server can use one of the compressions that the browser recognizes. For example, the response from the server contained in the response header is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"markdown\" class=\"language-markdown line-numbers\">HTTP\/1.0 200 OK\ncache-control: public, max-age=2592000\nexpires: Tue, 26 May 2020 01:18:29 GMT\ncontent-encoding: br<\/code><\/pre>\n\n\n\n<p>For example, The compression used by the server, in the header above is br (brotli). But keep in mind, that the server has no obligation to use any compression method. Because it depends on the server settings and the desires of the website owner.<\/p>\n\n\n\n<p>If the server did not use any compression recognized by the browser, the files will be sent without compression, where the response sent will be &#8220;<code>content-encoding: identity<\/code>&#8220;.<span id=\"d978e835-0e9b-46bf-b959-48af6a07a256\" data-items=\"[&quot;1129230858&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[9]\u200b<\/span><\/p>\n\n\n\n<p>If you are a website owner, it is recommended to use one type of HTTP compression on your site. Besides speeding up the page loading, compression can reduce the bandwidth load. Commonly, the compression used on a site is <em>gzip<\/em> or <em>deflate<\/em>.<\/p>\n\n\n\n<p>But currently, the brotli compression released by Google starting in 2013,<span id=\"85c30476-4bc9-4507-bb34-dc4e0acf89a0\" data-items=\"[&quot;1310121002&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[10]\u200b<\/span> has begun to be commonly used. This compression is claimed to be faster and results in smaller files than using gzip, where Javascript files are 14% smaller, HTML files 21% smaller, and CSS files 17% smaller.<span id=\"39833a0e-ebaa-40d4-a3b0-1e388d4355fe\" data-items=\"[&quot;2769175265&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[11]\u200b<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Image compression<\/h3>\n\n\n\n<p>Image compression can be a long topic to discuss. Many people often misunderstand the types of image compression. Because using the right type of image compression can make a significant difference to your website. Choosing wrong image compression can have some impacts on the images that look less good, or the file size becomes larger than expected.<span id=\"727876a1-c3aa-439b-b94b-3260e17e833a\" data-items=\"[&quot;757347585&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[12]\u200b<\/span><\/p>\n\n\n\n<p>One method of compression is lossless and lossy. Lossless is a compression method that keeps all the data from the original file. Otherwise, with the lossy compression method, there are some data deleted from the image, in order to reduce the image size significantly.<span id=\"315554b6-51bc-45a6-95b9-1677cb8da72e\" data-items=\"[&quot;1102347464&quot;]\" class=\"abt-citation\" contenteditable=\"false\">\u200b[13]\u200b<\/span><\/p>\n\n\n\n<p>However, many people feel that they need to use high-resolution images and with lossless compression on their website. As a result, their images have a very large size. This will directly increase the loading time of a web page. The impact might reduce visitors because of the long loading time of a web page.<\/p>\n\n\n\n<p>In general, how to compress images can be seen in our article on <a href=\"https:\/\/www.indowhiz.com\/articles\/en\/general-guidelines-to-improve-your-website-speed\/#5_Optimize_images\" target=\"_blank\" rel=\"noreferrer noopener\">general guidelines for increasing website speed<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">References<\/h2>\n\n\n\n<section aria-label=\"Bibliography\" class=\"wp-block-abt-bibliography abt-bibliography\" role=\"region\"><ol class=\"abt-bibliography__body\" data-maxoffset=\"4\" data-linespacing=\"1\" data-second-field-align=\"flush\"><li id=\"1889752853\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[1]<\/div><div class=\"csl-right-inline\">Google Developers, \u201cMinify Resources (HTML, CSS, and JavaScript),\u201d <i>Google Developers: PageSpeed Tools \u2013 Insight<\/i>, Dec. 14, 2018. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/developers.google.com\/speed\/docs\/insights\/MinifyResources\">https:\/\/developers.google.com\/speed\/docs\/insights\/MinifyResources<\/a> (accessed Apr. 23, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"3963805390\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[2]<\/div><div class=\"csl-right-inline\">I. Grigorik, \u201cOptimizing Encoding and Transfer Size of Text-Based Assets,\u201d <i>Google Developers: Web Fundamentals<\/i>, Feb. 12, 2019. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/developers.google.com\/web\/fundamentals\/performance\/optimizing-content-efficiency\/optimize-encoding-and-transfer\">https:\/\/developers.google.com\/web\/fundamentals\/performance\/optimizing-content-efficiency\/optimize-encoding-and-transfer<\/a> (accessed Apr. 24, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"1555504153\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[3]<\/div><div class=\"csl-right-inline\">Research Hubs, \u201cCombine JavaScript and CSS,\u201d <i>Research Hubs<\/i>, 2015. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"http:\/\/researchhubs.com\/post\/computing\/web-application\/combine-js-and-css.html\">http:\/\/researchhubs.com\/post\/computing\/web-application\/combine-js-and-css.html<\/a> (accessed Apr. 25, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"391374714\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[4]<\/div><div class=\"csl-right-inline\">J. Nguyen, \u201cWhy You SHOULDN\u2019T Combine CSS &amp; JS (Performance Reasons),\u201d <i>WP Johnny<\/i>, Jun. 04, 2018. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/wpjohnny.com\/why-you-shouldnt-combine-css-js-performance-reasons\/\">https:\/\/wpjohnny.com\/why-you-shouldnt-combine-css-js-performance-reasons\/<\/a> (accessed Apr. 25, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"4008438939\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[5]<\/div><div class=\"csl-right-inline\">I.  Grigorik and S. Surma, \u201cIntroduction to HTTP\/2,\u201d <i>Google Developers: Web Fundamentals<\/i>, Sep. 03, 2019. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/developers.google.com\/web\/fundamentals\/performance\/http2\">https:\/\/developers.google.com\/web\/fundamentals\/performance\/http2<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"3270003192\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[6]<\/div><div class=\"csl-right-inline\">edureka, \u201cHow to Implement CSS Sprites to Enhance Web-Pages,\u201d <i>edureka!<\/i>, Aug. 29, 2019. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.edureka.co\/blog\/css-sprites\/\">https:\/\/www.edureka.co\/blog\/css-sprites\/<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"4257910195\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[7]<\/div><div class=\"csl-right-inline\">M. Cerdas, \u201cGzipping vs Minification: What the heck?,\u201d <i>Medium<\/i>, Jan. 16, 2017. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/@manuelro\/gzipping-vs-minification-what-the-heck-ba698fa6037c\">https:\/\/medium.com\/@manuelro\/gzipping-vs-minification-what-the-heck-ba698fa6037c<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"1641409244\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[8]<\/div><div class=\"csl-right-inline\">IANA, \u201cHypertext Transfer Protocol (HTTP) Parameters,\u201d <i>Internet Assigned Numbers Authority (IANA)<\/i>, Jan. 22, 2020. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"http:\/\/www.iana.org\/assignments\/http-parameters\/http-parameters.xhtml\">http:\/\/www.iana.org\/assignments\/http-parameters\/http-parameters.xhtml<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"1129230858\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[9]<\/div><div class=\"csl-right-inline\">Mozilla, \u201cContent-Encoding,\u201d <i>MDN web docs: Web technology for developers<\/i>, Oct. 20, 2019. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Encoding\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Encoding<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"1310121002\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[10]<\/div><div class=\"csl-right-inline\">J. Alakuijala, E. Kliuchnikov, Z. Szabadka, and L. Vandevenne, \u201cComparison of Brotli, Deflate, Zopfli, LZMA, LZHAMand Bzip2 Compression Algorithms,\u201d The Comprehensive R Archive Network, Sep. 2015. Accessed: Apr. 26, 2020. [Online]. Available: <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/cran.r-project.org\/web\/packages\/brotli\/vignettes\/brotli-2015-09-22.pdf\">https:\/\/cran.r-project.org\/web\/packages\/brotli\/vignettes\/brotli-2015-09-22.pdf<\/a>.<\/div>\n  <\/div>\n<\/li><li id=\"2769175265\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[11]<\/div><div class=\"csl-right-inline\">M. Mike, \u201cYou can\u2019t use Brotli for dynamic content,\u201d <i>Expedited Security Blog<\/i>, Jun. 25, 2018. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/expeditedsecurity.com\/blog\/nginx-brotli\/\">https:\/\/expeditedsecurity.com\/blog\/nginx-brotli\/<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"757347585\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[12]<\/div><div class=\"csl-right-inline\">C. Chapman , \u201cEverything You Need to Know About Image Compression,\u201d <i>JotForm Blog<\/i>, Feb. 03, 2010. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.jotform.com\/blog\/everything-you-need-to-know-about-image-compression\/\">https:\/\/www.jotform.com\/blog\/everything-you-need-to-know-about-image-compression\/<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><li id=\"1102347464\">  <div class=\"csl-entry\">\n    <div class=\"csl-left-margin\">[13]<\/div><div class=\"csl-right-inline\">A. Orru, \u201cWhen Less Is (Really) More: How To Compress Your Images And Reduce Their File Size,\u201d <i>WP Rocket Blog<\/i>, Feb. 12, 2020. <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/wp-rocket.me\/blog\/compress-image-for-web\/\">https:\/\/wp-rocket.me\/blog\/compress-image-for-web\/<\/a> (accessed Apr. 26, 2020).<\/div>\n  <\/div>\n<\/li><\/ol><\/section>\n\n\n\n<p>Feature image by pikisuperstar on <a rel=\"noreferrer noopener\" href=\"https:\/\/www.freepik.com\/free-vector\/transfer-files-concept-landing-page_5566766.htm\" target=\"_blank\">Freepik<\/a><br>Figure 2 modified from <a rel=\"noreferrer noopener\" href=\"https:\/\/www.freepik.com\/free-vector\/file-formats_800966.htm\" target=\"_blank\">Freepik<\/a><br>Figure 7 modified from <a rel=\"noreferrer noopener\" href=\"https:\/\/www.freepik.com\/free-vector\/icons-collection-business-card_5548812.htm\" target=\"_blank\">Freepik<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commonly, there are many ways to increase website speed. One of them is to optimize the web page file size. These files such as images, CSS, Javascript, HTML, and other supporting files. The smaller the file size of a web page, the better. If you use WordPress, almost all of the optimizations in this article [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2051,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[491],"tags":[406,400,402,416,412,410,401,414,408],"class_list":["post-2060","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-concept","tag-beautification","tag-css","tag-css-sprite","tag-file-size","tag-http-compression","tag-image-compression","tag-js","tag-minification","tag-web-page"],"modified_by":"Philip F. E. Adipraja","_links":{"self":[{"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/posts\/2060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/comments?post=2060"}],"version-history":[{"count":3,"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/posts\/2060\/revisions"}],"predecessor-version":[{"id":7994,"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/posts\/2060\/revisions\/7994"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/media\/2051"}],"wp:attachment":[{"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/media?parent=2060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/categories?post=2060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.indowhiz.com\/articles\/wp-json\/wp\/v2\/tags?post=2060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}