# 30 Ways To Improve Your Website Performance | PageDart > ## Excerpt > 30 ways to improve your website performance with actionable improvements and no fluff explanation --- It can be daunting when trying to improve website performance. Where do you start? With recommendations changing all the time, how can you make sure that you are not left behind? With so many areas to improve, where is the best place to concentrate your efforts? This article breaks down website performance into small tasks. ![30 Ways To Improve Your Website Performance](https://pagedart.com/images/30-ways-to-improve-your-website-performance/rocket.jpg) Each one of the tasks is actionable, we will ask: - WHY are we improving this aspect of the site - WHAT to check on the page - HOW to make the improvement We will also categorize the impact of fixing each task so that you get the biggest bang for your buck. - High - A large increase in site speed - Medium - Depending on the structure of your site this will have a significant speed increase - Low - Small increase but worth looking at. It all adds up. There is no fluff here. All the improvements are actionable and you can increase your site speed today! We only need a single tool to investigate the improvements on your site. Google Chrome Developer Tools. To access these tools open Chrome and navigate to your site. Right-click the page and choose the “Inspect” option. You now have developer tools open, let's improve your site! Here is the checklist of improvements we are going to make: - [Images](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#images) - [Compress Images](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#compress-images) - [Crop Images to Correct Aspect Ratio](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#crop-images-to-correct-aspect-ratio) - [Remove Image Metadata](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#remove-image-metadata) - [Lazy Load](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#lazy-load) - [Create Responsive Images](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#create-responsive-images) - [Use Vector Graphics](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#use-vector-graphics) - [HTML](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#html) - [Minify the HTML](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#minify-the-html) - [Remove Boolean Attributes](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#remove-boolean-attributes) - [Remove HTML Comments](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#remove-html-comments) - [Remove Legacy Tag Attributes](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#remove-legacy-tag-attributes) - [Minify inline CSS and Javascript](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#minify-inline-css-and-javascript) - [Load CSS Before Javascript](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#load-css-before-javascript) - [Limit iFrames on Page](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#limit-iframes-on-page) - [Use Pre-load](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#use-pre-load) - [Javascript](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#javascript) - [Minify the Javascript](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#minify-the-javascript) - [Async Loading](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#async-loading) - [Bloated Frameworks](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#bloated-frameworks) - [Latest Version](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#latest-version) - [CSS](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#css) - [Minify the CSS](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#minify-the-css) - [Unused CSS](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#unused-css) - [Above the Fold](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#above-the-fold) - [Use Preload](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#use-preload) - [Remove Inline CSS](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#remove-inline-css) - [Fonts](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#fonts) - [Use WOFF2](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#use-woff2) - [Use Pre-connect](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#use-pre-connect) - [Server](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#server) - [Compression](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#compression) - [Caching](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#caching) - [HTTPS](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#https) - [H2](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#h2) - [Reduce Cookies](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#reduce-cookies) - [Frequently Asked Questions](https://pagedart.com/blog/30-ways-to-improve-your-website-performance/#frequently-asked-questions) As you can see we have a lot to get through. Once you have performed these tasks a few times, it will feel like second nature. At a high level there are three principles we are following: - Page assets should be as small as possible (Known as Page Weight). - Download only the assets we need to show the page (Async Loading). - Download assets we need in advance (Pre-loading) All 30 improvements fall into one or more of these three principles. Simple, right? Before we get started one word on monitoring. ## Monitoring Before we start improving the site we need to track performance. If we neglect this step it will be hard for you to learn what has worked and what has had little affect. The principle we need to follow is: Improve, then measure. To measure your site I would recommend that you use the Google Lighthouse tool. ![Google Lighthouse](https://pagedart.com/images/30-ways-to-improve-your-website-performance/lighthouse.jpg) In the article [Benchmark Websites](https://pagedart.com/blog/benchmark-websites/), I show you how you can use a Google Sheet to track the performance. The Google Sheet tracks the performance daily so you can see how your site speed improves over time. You can also use PageSpeed Insights or WebPageTest.org if you prefer. Now we have monitoring in place lets dive into the improvements. ## Images When optimizing a new site start with images. They are the number one cause of website performance issues. They also account for over 60% of pages total page weight. Luckily, there are lots we can do to improve them. ### Compress Images Impact: High #### Why You can compress images without losing quality. A photo taken with a camera will be a large file and we can use compression to reduce the file size. By selecting the correct compression type, we can reduce image size by up to 90%. #### What To check if compression could improve the images on your site, use the Dev Tools and select the network tab. You can filter by “Img” and it will show you the images downloaded. In the size column, it will show the resource file size and the downloaded file size. It's the resource file size we are looking at. If you see files that are larger than 100kb it's time to try compression. #### How Follow these rules when deciding on the type of compression to use: - If the image is a JPEG and larger than 100kb compress again using JPEG. - If the image is a PNG and it has no transparency then use a compressed JPEG. - If the image is a PNG is transparent then use WebP and fallback to an optimized PNG. A great tool to use for image compression is [Squoosh](https://squoosh.app/). ![Squoosh](https://pagedart.com/images/30-ways-to-improve-your-website-performance/adjust.jpg) It allows you to see a before and after using a slider as above. ### Crop Images to Correct Aspect Ratio Impact: Medium #### Why If you are showing square images, make sure that the image you download is also square. In other words, keep the aspect ratio the same. Why download a rectangle image but then display a square. You are downloading more pixels than needed. ![Cropped Images](https://pagedart.com/images/30-ways-to-improve-your-website-performance/carousel.jpg) This adds to the download size and it will slow down the display of the image. #### What Look through the images on the site. Can you see anywhere the display ratio is different from the image ratio? Look for image cropping within CSS like this: ``` img { object-fit: cover; } ``` This is a sign that images are being cropped. #### How Using the resize tool from [Squoosh](https://squoosh.app/) we can take an image and change the aspect ratio. ### Remove Image Metadata Impact: Low #### Why When we take a photo the image contains metadata. Data such as the camera specification and even the location of the photo. This can all add weight to the image and is not needed by your customers. #### What To check if your images have this, use an online image metadata tool like [metapicz](http://metapicz.com/) to see. Enter the image URL into the tool and it will return any metadata held within the image. ![Image Metadata](https://pagedart.com/images/30-ways-to-improve-your-website-performance/metadata.jpg) #### How Many image compression tools such as [Squoosh](https://squoosh.app/) will remove the metadata when compressing. ### Lazy Load Impact: High #### Why [Lazy loading](https://pagedart.com/blog/what-is-lazy-loading/) is the technique of loading images only when they become visible to the user. If you have below-the-fold images, you should consider lazy loading them. This means that the initial page can load quicker as it only downloads the images at the top of the page. #### What To see if your page has enabled lazy loading open Dev Tools and clear the network tab. Start to scroll the page. If there are network requests for images as you scroll down, then lazy loading is in use. #### How Native lazy loading is the simplest way to take advantage of this technique. There is a free [Wordpress plugin from Google](https://wordpress.org/plugins/native-lazyload/) you can add to your site. If you are not using Wordpress then use the loading attribute on your images, like this: ``` Awesome Cat! ``` Native lazy loading is only supported by Chrome as of 2019 but this will improve over time. There are many Javascript implementations that you can try. ### Create Responsive Images Impact: Low #### Why There are many different size devices in use today. Mobile, tablet, and desktop all working at different resolutions with different screen sizes. There are also retina displays that have 2x or 3x the pixels. ![Responsive Images](https://pagedart.com/images/30-ways-to-improve-your-website-performance/responsive.svg) To support these devices we want to show a nice clear image. We do not want to have blurry images that negatively affect the user experience. We should provide different images for each resolution. #### What Check to see if there are any picture tags in the HTML. You are then looking for different sources of the same image. It can help to search for “srcset” in the markup. #### How To support different resolutions we need to create images at various widths. It's common to see 3 widths for mobile, tablet and desktop. Use the `` tag to add images at different widths: ``` Cat ``` ### Use Vector Graphics Impact: Low #### Why Vector graphics are images that do not lose quality when they get resized. In the last improvement, we created many different versions of an image so that it can scale to the user's device. With vector graphics like SVG, we can scale a single image without losing quality. ![SVG Vector Image](https://pagedart.com/images/30-ways-to-improve-your-website-performance/vector.jpg) As we zoom in on the peach stone above we lose no quality, the image stays clear. This works for logos, graphics, and icons that are on your page. #### What Look for any images in the network tab that you can convert to SVG. These will be sprite sheets, logos, and any graphics. Unfortunately, it does not work for Photos. #### How You can save in most vector graphics packages to SVG format. Make sure that you add server-side compression to any SVG files. See more on this improvement later on in the list. ## HTML When we optimize the HTML, we are making sure that we reduce the file size and load the assets efficiently. ### Minify the HTML Impact: Medium #### Why The first principle was: > Page assets should be as small as possible. The smaller the HTML file is, the faster it will download to the browser. There is a knock-on effect as the faster the HTML downloads the quicker the assets can start downloading. Often, we minify CSS and Javascript but rarely do I see HTML minified. #### What To see if your site has a minified HTML file, open up Chrome Developer Tools and select the network tab. After, refreshing the page click on the first row. This will be the HTML. Click on the response tab and look to see if there are spaces and indentations. ![Compress HTML](https://pagedart.com/images/30-ways-to-improve-your-website-performance/compress-html.jpg) If there are then the file is not minified. Let's look at how we can minify it. #### How We can use a tool such as an [HTML minifier](http://kangax.github.io/html-minifier/) to make the file smaller. There are many options to choose from, some of the important ones we will dig into in more detail next. For an initial idea of what this looks like accept the defaults for now. You should see that it has removed all the spaces and indentations. ### Remove Boolean Attributes Impact: Low #### Why We often include markup in our HTML such as: The markup above is the same as this: Notice the missing `="true"`. There is no need for the extra `="true"` and this text is redundant. It is safe to remove all these default true values from your HTML. #### What To check if your site has this open Dev Tools and click on the “Elements” tab. This will show the HTML and you can perform a search for “true”. If you find some you can remove them. #### How Most HTML minifiers will have an option to remove these values. The [HTML minifier](http://kangax.github.io/html-minifier/) tool we mentioned above has a “Collapse boolean attributes” option. To remove the “true” values check this checkbox. Impact: Low #### Why Comments are often found in HTML. They are there to help a developer or technical stack-holder understand the markup. These comments are not useful to your customer. There is no need for them on a production website and so you can remove them. #### What When looking at the HTML file in Dev Tools, look for any green highlighted text. ``` ``` If you find some these are comments and you can remove them. #### How The [HTML minifier](http://kangax.github.io/html-minifier/) can remove these comments for us. There is a section in the options called “Remove comments”. Check this to remove all comments from the file. ### Remove Legacy Tag Attributes Impact: Low #### Why There are many defaults in HTML 5 that make some markup redundant. It is important to be aware of these defaults so that you know what to remove. #### What In Dev Tools click the “Elements” tab and search for “text/javascript” and “text/css”. Which will return results like this: ``` ``` This would tell the browser that we were going to load a script tag and run Javascript. This is no longer required. Now all browsers by default will assume that a script tag is loading Javascript. Replace the above code with: #### How Again, using an [HTML minifier](http://kangax.github.io/html-minifier/) there is an option labeled “HTML5”. Check this when minifying and it will remove these attributes. ### Minify inline CSS and Javascript Impact: Medium (depending on the amount of CSS and Javascript inlined) #### Why If the HTML file has Javascript or CSS within the HTML file (called “inline”). For example: ```