EDITS.WS

Tag: Page speed and caching

  • Caching for WordPress: What It Is and How It Works

    “What’s caching? And what does this mean for my WordPress site?”

    As an amateur site owner, you’ve most likely stumbled across the word “cache/caching” or the phrase “use a caching plugin” and found yourself scratching your head over the exact same question.

    (Trust us – we know the feeling!)

    You see:

    One of your primary goals as a website owner is to drive traffic to your site. But if your visitors experience slow page speeds or your website takes more than 4 seconds to load, they will most likely click out without even reading the content. 

    And the result? 

    Increase in bounce rate and all your hard work going in vain.

    Luckily, this is exactly where website caching comes to the rescue! 

    Caching is one of the most powerful tools to improve performance, even if you have yet to start using it. 

    In simple words, caching can make your WordPress website fast. Like, really fast.

    OK, we know what you’re thinking:

    If website caching is this powerful, it must surely be a complex technical task to do, right?

    Turns out, it’s not as complicated as you may have thought.

    In this post, we’ll take a closer look at what caching is, how it works, its benefits, and how you can enable it on your WordPress site – and a lot more!

    What is WordPress Caching?

    Let’s break down the idea of caching in WordPress this way:

    Imagine someone asking you a difficult math problem, like: “What’s 9895357 times 8975?”.

    You will look around all confused and won’t be able to answer the question immediately. 

    Suddenly, the idea of bringing out a calculator hits you. 

    And a few minutes later, after doing the math, you get to know the correct answer and respond back.

    Now, if that person asks you the same question again, you will reply at that very minute. That’s because the time-consuming process and hard work had already been done thanks to the calculator. 

    And that’s it! That’s caching in a nutshell.

    If we apply it to the context of your WordPress website:

    1. A user visits your website and makes a request.
    2. Your web server takes some time to process.
    3. And finally, after a few seconds, it responds to the request by delivering the page.

    And it doesn’t stop there.

    The server saves a copy of that webpage so that when another visitor makes the same request, it can skip the initial time-taking process and provide the web page much faster.

    So, What Does Caching Mean?

    If we sum up the whole scenario:

    Caching is the storing of frequently used data so it can be accessed faster if someone needs it again. It also prevents the browser from utilizing its resources to load the entire site files again.

    It’s simple, isn’t it?

    Now before we go any further, let’s discuss the types of caching first.

    Types of Caching 

    Three of the most common types of caching are:

    1. Site Cache (Page Caching)

    A site cache, also known as page cache, temporarily stores website data (such as images, webpages, files, and similar multimedia) the first time a web page is loaded. So whenever a user revisits your website, saved elements are quickly retrieved and displayed to them.

    However, site caching is a type of client-side caching. This means that all the stored data is controlled by the end user. And as a website owner, your only authority is to specify how long content remains in the cache.

    Site caching is perfect for sites with a lot of static content. Because when your website rarely updates, visitors will be able to continue loading your web pages fast while still seeing the latest version of your site. 

    On the other hand, it isn’t well-suited for dynamic websites where content frequently updates, such as e-commerce pages with shopping carts.

    So, what’s the magic formula?

    Consider using a WordPress plugin to take full benefit from site caching. 

    There are various caching plugins, like WP Rocket, that you can use to control WordPress site caching. 

    WP Rocket is a straightforward caching plugin used to take care of caching across different devices, optimize your files, and improve your website’s performance.

    (P.S: We’ll discuss more of the caching plugins in the upcoming sections)

    2. Browser Cache

    Like site caching, browser caching also happens on the client’s end. 

    It works the exact way as site caching but is a cache system built into a web browser. The browser temporarily saves copies of a website’s files, including:

    • HTML code
    • CSS stylesheets
    • JavaScript scripts
    • Images

    These files are known as “static assets” because they don’t change between visits.

    It all boils down to this:

    When the user revisits your website, their browser will fetch the cached files and utilize them to assemble your website’s content. And because of this, it doesn’t have to load everything from scratch.

    Typically, a web browser will keep its cache for a limited time or until it is full. After that, it will automatically flush out the old content and save the updated one in its place.

    However, as a user, you can also manually clear out your browser’s cache whenever you want.

    3. Server Cache

    Server caching is also similar to site caching, but instead of saving the content on the client’s end, it keeps the content on a site’s server. 

    This type of caching is administered on the server without any input from the end user.

    For example:

    Your server stores HTTP files of your website’s content and serves them immediately when the visitor requests. That way, it doesn’t have to render a new HTTP file every time a user visits the site, reducing the load.

    Some of the types of server caching include:

    • Object Caching – stores database queries in a server-side cache so that the next time a visitor requests content, the server can deliver it immediately without having to query the database repeatedly.
    • Opcode Caching – occurs when the PHP file loads on a web page for the very first time. It stores the results of the PHP script for faster loading instead of executing every single time your website receives a request.
    • CDN Caching – A Content Delivery Network (CDN) is a system of servers located worldwide. When a user visits your website, the CDN will serve cached files from the server closet to them in order to reduce loading times.

    Why Does Caching Seem To Break Stuff?

    – Want to know the scary part? 👻

    Caching works flawlessly with web pages having static content (content that doesn’t change unless you change them), such as text, photos, and videos.

    But nowadays, websites have a lot of content or features that update automatically or adjust differently for each user looking at the page.

    Let us give you some examples:

    One example could be an online streaming site. Dynamic entertainment websites (like Netflix) allow their content to be displayed according to a user’s location, watching activity, preferences, and subscription. 

    This is an example of dynamic content because content adjusts according to who is looking at the page.

    Another example is an e-commerce site.

    These websites contain a shopping cart icon on every page, telling customers the total number of items available in their shopping cart. This feature varies for each customer because everyone has a different number of items in their cart. Therefore that number is dynamically generated for each customer.

    This type of content needs special care with caching. You need to code things correctly – and if you don’t do that and use a caching plugin, you’ll notice that the website won’t respond as usual (considering the above example: the customer’s cart won’t be able to display the accurate number of items available).

    Now, in case you might be wondering:

    The main culprit here is PHP!

    If the dynamic features present on your website are coded in PHP for output retrieval, they won’t work with caching.

    Remember what we discussed at the beginning? Caching stores a copy of your webpage, so the server doesn’t have to load it again when requested. 

    Basically, PHP is part of the time taking work that gets neglected when you use caching.

    So when you want your website to have dynamic features, you need to use another programming language called JavaScript (JS). JS operates on the browser’s side, so when your page is cached, and PHP is sitting idle, you can rely on JS and AJAX (Asynchronous JavaScript and XML) to handle the dynamic needs of your website.

    Can a Caching Plugin Help, and How?

    Good news:

    The easiest solution for all this is to use a caching plugin on your WordPress site!

    A caching plugin is a holy grail for eliminating some of the various steps taken by a browser in generating dynamic web pages. By using a caching plugin, you can achieve various server-side caching benefits (including page caching and object caching). 

    Moreover, these plugins also know to offload their cache and renew it whenever a fresh piece of content is published or existing content is updated on your site.

    And what’s even better:

    With top caching plugins, like WP Rocket, you can also get added performance optimization features that significantly help improve the Lighthouse Performance Score and metrics – including Core Web Vitals – of your WordPress site!

    How Caching Works in WordPress

    Here’s how caching works:

    A cached page will be created for each web page, and when a visitor visits your website, they will be delivered the cached (static) version of each page. 

    Within a matter of seconds, WordPress caching plugins minimize the amount of data transmitted between the visitor’s browser, the WordPress database, and the web server, keeping visitors engaged with your site with faster loading times.

    How caching works  – Source: Kinsta

    How a Caching Plugin Works?

    There are many types of caching plugins available for WordPress that make caching a very easy process.

    Let’s take WP Rocket as an example:

    Using the WP Rocket plugin, you can instantly cache your website by just activating it . In addition, you can enable caching for mobile devices and logged-in WordPress users and specify the time after which the cache will be cleared. 

    Cache tab using the WP Rocket plugin

    What’s the catch?

    It’s the simplest caching plugin that works straight out of the box and doesn’t require technical knowledge! 

    It applies 80% of performance best practices right upon activation – including site (page) cache and cache pre-loading.

    All these features make WP Rocket the most beginner-friendly caching plugin to take care of your WordPress caching and make your website blazing fast! 🚀

    A word of caution: If you’re planning to install more than one caching plugin, thinking it will make your site faster, stop there! Installing more than one plugin won’t make your site any faster. Instead, it’ll make your site slower or even break it. 

    Why Is Caching Important for Your WordPress Site?

    Whether you want to start today or in the future – you’ll always need caching for your website. 

    Here are some of the other benefits of caching for your WordPress site:

    1. Makes Your Site Faster 

    Speed is crucial for a website. If your site takes too long to load, not only will your website users abandon it, but Google will also penalize it leading to lower rankings. 

    That is why one of the primary benefits caching offers is improved site speed!

    This results in much faster, easy-to-crawl websites and has a significant impact on your Core Web Vitals grades and the PageSpeed Insights performance score. 

    Why is it important? 

    Because Core Web Vitals metrics are part of Google’s Page Experience Update – the latest ranking factor launched by Google in 2021. 

    Core Web Vitals combined with a better PageSpeed Insights performance score may positively affect your website’s organic visibility and give visitors a hassle-free experience while browsing your page.

    2. Improves User Experience 

    A fast website = a great UX!

    Faster websites are known for reducing bounce rates, as users are not interested in waiting for a website that takes 10 seconds to load. So when the website moves faster for visitors, they will love browsing through it. 

    Most importantly, it will put a great first impression on a visitor landing on your website. One glimpse can turn someone into a customer or urge them to move on to another website. So first impressions matter the most when it comes to a website. 

    3. Helps Improve Conversions

    Faster-loading websites help in higher rankings, and higher rankings mean more traffic!

    When you combine it with a good user experience, it will turn all your visitors into actual customers and improve your conversion rate.

    4. Reduces Server Load

    As caching displays a static copy of the requested webpage, it puts less of a strain on your server and lowers server load by up to 80%. This is especially beneficial when it comes to highly dynamic sites or during traffic spikes.

    5. Improves Time to First Byte (TTFB)

    Caching is probably one of the easiest ways to lower your Time to First Byte globally. Once your website is cached, resources don’t need to be downloaded every time from the server – leading to reduced server processing time!

    How to Enable Cache in WordPress

    Here’s how you can manually enable caching on your WordPress site:

    Step 1: Open the wp-config.php file, which you will find in the root folder of your website.

    If you don’t know where exactly the wp-config.php file is located:

    1. Log into your hosting account.
    2. Go to cPanel.
    3. Click on the ‘File Manager.’
    4. Locate the ‘public_html’ folder.

    You will find the wp-config.php in this folder.

    Step 2: Edit the line that says 

    define ('WP_CACHE', false);

    And change it to:

    define('WP CACHE', true);

    Step 3: Create a file named “advanced-cache” and place it within the wp-content directory, just like this:

    /wp-content/advanced-cache.php/

    How to Enable a WordPress Caching Plugin

    Now, if you want to save time by not doing the technical work, then caching plugins offer a quick and easy way to enable caching on your WordPress site!

    But unfortunately, most caching plugins come with features that require technical expertise and can easily confuse a user who is not a developer.

    However, this is not the case with WP Rocket. 

    Installing WP Rocket is the easiest way to enable caching in WordPress. One of the features that makes it the best caching plugin for WordPress is that once you activate it within just a few clicks, you’re already set up and ready to go.

    Here’s how you can do it:

    • First, you need to install and activate the WP Rocket plugin.
    • Once activated, the WP Rocket plugin will automatically turn on the page and browser caching with optimal settings for your site.
    • You can see your site’s caching status by visiting the WP Rocket dashboard under the WordPress Settings » WP Rocket page.
    WordPress Admin page – Settings Section

    Once you land on the Dashboard tab, you’ll get this message:

    WP Rocket dashboard – Congratulations message

    As for the caching tab, you can find the settings under Settings » WP Rocket » Cache.

    In addition to automatically enabling page and browser caching, WP Rocket will activate by default Mobile Cache and Cache lifespan (10 hours). In this tab, you can tweak the settings according to your needs.

    Cache tab using the WP Rocket plugin
    Cache tab using the WP Rocket plugin

    Moreover, the plugin includes other crucial features, such as the ones to optimize CSS and JS files, that go beyond caching and make WP Rocket the easiest and most powerful solution to improve your website performance. 🚀

    Wrapping up

    *sigh* – that surely was a hell of a ride.

    We hope you find this article helpful!

    Website caching is the best way to speed up your WordPress website without sacrificing content or other performance factors. It doesn’t have to be technical or complex. When properly implemented, it will result in much faster load times for your users while decreasing overall server load.

    If you’re not caching your WordPress website already, it’s time to get started. You can never go wrong by caching your WordPress site. In fact, it could be one of the biggest ways to your online success.

    The post Caching for WordPress: What It Is and How It Works appeared first on WP Rocket.

  • Yes, Your WordPress Site Can Deliver Outstanding Web Performance: Here’s Why (and How)

    It’s all over the industry news: WordPress has lost 0.4% market share since February. While the percentage is small and doesn’t change anything for real, the WordPress community has discussed the reasons for this drop. Among the culprits, there’s the assumption that WordPress sites don’t perform as well as other CMS speed-wise – at least when looking at aggregate data. 

    At WP Rocket, we deeply care about educating users on achieving better web performance and making it easier for everyone – and that’s why we want to share our point of view on the matter. For starters, we think it’s nonsense to compare WordPress performance to other CMS because there are several variables to consider that make it unfair and misleading. 

    The truth is, WordPress can deliver excellent web performance. In our opinion, this is not why market share is slightly declining. 

    The difference between WordPress and other CMS lies in the actions you are required to do on your own to improve your site speed. These steps are not necessarily complex and can be done in a few clicks according to your specific needs. Yet, they add some complexity to the overall experience of WordPress.

    In this article, you’ll understand what makes WP different from other CMS and why saying that WordPress can’t deliver excellent performance is inaccurate. Plus, you’ll learn how to make the most of the WordPress site for performance. 

    Debunking 4 Misconceptions About WordPress Performance

    When it comes to WordPress performance, there are some common wrong assumptions. Let’s start by clearing them up.

    1. WordPress can’t deliver excellent performance for complex and high-traffic sites such as eCommerce

    It’s not true. Performance hugely depends on the hosting, the page builder, and the plugins you choose. It doesn’t matter how many visitors your site gets every day or the type of site you have – get the right things in place, and you’ll achieve the results you want. 

    2. Plugins: the more, the better for performance

    This is also not true. You don’t need many plugins to make your site faster. It’s quite the opposite: you should carefully choose what to install to prevent your site from dealing with many JS-based plugins and slowing down. Do you even have a slider? Then you should read our article on the bad performance practices.

    3. WordPress doesn’t perform well on mobile devices

    Mobile performance depends on the theme – you should choose a responsive one. It doesn’t have anything to do with WordPress itself. Simple as that.

    4. WordPress doesn’t include a CDN as default, which makes the site slower

    First things first: CDN is necessary if you have a worldwide audience. Otherwise, you don’t even need it. Either way, installing a CDN can be easy and hassle-free. Once you get it, there won’t be any difference between your site on WordPress and another CMS.

    Now that we explained which ideas about WordPress and performance are wrong, let’s see why WordPress is not like other website building platforms.

    What Makes WordPress Performance Different from Other CMS

    As mentioned in the introduction, comparing WordPress performance to other CMS is inaccurate because there are several factors to consider, and looking at aggregate data can be misleading.

    First and foremost, WordPress is chosen for all types of sites, including tiny ones that don’t even care about performance. This is the first key point to keep in mind. 

    As you can see from the CMS distribution, only 13% of WordPress sites are among the top 10k sites – the ones that get the highest traffic volume.

    CMS Usage distribution - Top 10k Sites - Source
    CMS Usage distribution – Top 10k Sites – Source

    The percentage goes up to 20% when looking at the 100k sites.

    CMS Usage distribution - Top 100k Sites - Source
    CMS Usage distribution – Top 100k Sites – Source

    The distribution gets even higher when looking at the sites included in the top 1 million sites: it’s now 34%. This figure validates the assumption that many small sites use WordPress as opposed to high-traffic ones. It goes without saying that small and low-traffic websites invest in performance less than the big ones.

    CMS Usage distribution - Top 1 Million Sites - Source
    CMS Usage distribution – Top 1 Million Sites – Source

    Another interesting data point comes from comparing WooCommerce vs. Shopify. While WooCommerce is the most popular solution for the top 1 million sites, Shopify does better for the top 100k and 10k sites. Especially for the top high-traffic sites, the distribution difference is vast:

    Top 1 million sites Top 100k sites Top 10k sites
    WooCommerce 29% 15% 8%
    Shopify 21% 21% 21%

    This data brings us to the second important point about managed vs. shared hosting

    CMS like Shopify or Wix come with a managed hosting service. On the other hand, WordPress gives you a choice between a more powerful managed hosting and a less potent shared one. Shared hosting is suitable for small sites – and we’ve just seen how many tiny sites WordPress hosts. 

    Some recent stats also show the most popular WordPress hosting providers. On top, there’s BlueHost, which offers shared hosting. The same goes for Automattic and DreamHost.

    Most popular WordPress hosting providers - Source
    Most popular WordPress hosting providers – Source

    While shared hosting is convenient in price, it can’t deliver the same performance as managed hosting. As a result, more sites using shared hosting will perform worse than those using CMS with managed hosting. Can you see why comparing CMS performance is difficult when the starting point is much different? It looks like we’re comparing apples to oranges.

    For instance, look at how sites using WP Engine as their hosting are performing in terms of Core Web Vitals grades. The percent of good Core Web Vitals is up to 38,1% as opposed to WordPress (28,7%):

    Core Web Vitals Technology Report - Source
    Core Web Vitals Technology Report – Source

    And other factors are in play.

    Plugins can make a big difference, too. You should choose the right plugins to make your site as fast as possible. With the right choices, there won’t be any performance difference compared to other platforms with default options. Once again, though, the starting point can be different.

    A CDN also affects performance. On WordPress, you can decide if you want a CDN according to your needs. Other platforms such as Wix, Shopify, and Squarespace already use a CDN. So, by default, they’re faster. Remember that a CDN plays a crucial role in speeding up your site if you have an international audience. 

    What Such Differences Entail for Users (and Market Share)

    You can now see how WordPress has an excellent performance potential – if you know how to do it.

    And here’s the thing. If you’re wondering what makes WordPress less appealing on the market, we say that WordPress is not easy enough for every user. So, complexity is the main culprit for users choosing other CMS (or switching to them). It would be naive not to mention the marketing budget that allows companies such as Wix and Shopify to stand out and get advertised on TV and so on – such coverage can make a great difference in customers’ perception and choices.

    WordPress is free and is open-source software – and that’s great. It’s also customizable for any site, including large ones. Thanks to great options among plugins and themes, you have the freedom to choose how to build your site. You don’t have to stick to default options. Plus, you can benefit from free tools if you’re on a budget.

    On the other hand, for the same reasons, WordPress can’t make substantial improvements to its core – for instance, it can’t add a CDN option. Overall, we think there will always be a gap with other CMS in terms of built-in options. And this gap can also affect market share.

    Once again, it’s important to highlight how WordPress still dominates the market share. Looking at the historical trends in 2022, it’s interesting how Wix is growing faster than the other CMS.

    February 2022 30 May 2022 Feb 2022 vs. May 2022
    WordPress 43,3% 42.9% -0,4%
    Shopify 4,4% 4,3% -0,1%
    Wix 1,9% 2,3% 0,4%
    Squarespace 1,8% 2,0% 0,2%
    Source: w3tech

    How to Get an Outstanding Performance on WordPress 

    All that said, you can always make your site as fast as possible on WordPress. Here are some best practices to follow that will help you boost your site speed.

    The first is choosing a managed hosting service over a shared one. A managed hosting solution is more expensive. However, it helps you get the best performance for your site. If you’re looking for a great solution, you have several options, including Kinsta, WPEngine, and Flywheel.

    Next, you should choose only a few plugins – the less, the better. Among them, you should include a caching and performance plugin. If you’re looking for a paid solution, our recommendation is, of course, WP Rocket. Remember what we said in the previous section? Choosing the right plugins can make things easy – and WP Rocket takes care of complex performance issues and boosts your site speed in just a few clicks. As WPMarmite recommends in their article, taking performance to the heart is crucial to achieving excellent results.

    For instance, here’s some data showing how WP Rocket helps get good Core Web Vitals – even more than other platforms such as Wix and Squarespace.

    Core Web Vitals Technology Report - WP Rocket - Source
    Core Web Vitals Technology Report – WP Rocket – Source

    The beauty of WordPress is that you can also go with a free plugin. Regarding improving your site performance, here are a few free options that tackle some of the most crucial performance issues, such as CSS and JS optimization:

    You should also pick an image optimizer. This is essential to make your images lighter and give a crucial boost to your site speed. Imagify is our plugin to compress and convert images to WebP. Want more options? Read our list of the best image optimization plugins to discover other plugins for your WordPress website.

    As already explained, a CDN is also essential for boosting performance for an international audience. You can choose easy and 100% hassle-free solutions like RocketCDN or explore other CDN services like StackPath or Akamai.

    The last key point to remember is choosing a fast and responsive theme. You can pick the best solution among the fastest free WordPress themes we listed in our article or go for a paid solution. It is essential to pay attention to your theme’s performance and ease to make the whole site experience fast and smooth.

    Blazing-fast WordPress Sites: Two Examples

    Let’s now look at a site built on WordPress and performing great. 

    We could include WP Rocket, but it would be too easy, right?

    Instead, we picked two websites. As you’ll see, they differ from each other in size and topics.

    The first one is Olga Zarzeczna’s site. Olga is a technical SEO expert and she already explained how WP Rocket allowed her to focus on the most important aspects of her business because our plugin would take care of performance optimization.

    Her site follows the best practices above and passes the Core Web Vitals assessment. The Page Speed Insight score is 94/100.

    Google PageSpeed Insights report - Source
    Google PageSpeed Insights report – Source

    The second site is completely different. In fact, it’s a French government site on ecological transition. It shows how important sites can also be built on WordPress and achieve outstanding performance.

    Google PageSpeed Insights report - Source
    Google PageSpeed Insights report – Source

    Wrapping Up

    In this article, we explained why we believe WordPress is a great platform to speed up your site and why it’s different from other paid CMS. We also shared our point of view about why WordPress’s market share is shrinking – even though the percentage is so small that it doesn’t matter now. 

    WordPress offers many advantages, from being an open-source software to being customizable for all needs and budgets. Plus, there’s a great community behind WordPress that supports all members through online channels, local events, and WordCamps. If you are worried about performance, remember that this is not a good reason not to choose WordPress. Your site can be as fast as any other site built on another platform.

    The post Yes, Your WordPress Site Can Deliver Outstanding Web Performance: Here’s Why (and How) appeared first on WP Rocket.

  • How to Test DNS Server Response Time to Troubleshoot Site Speed

    When it comes to decreasing your website’s load times, your DNS and how quickly it responds are often overlooked.

    Without it, users would need to remember the long string of numbers of your IP to visit your website instead of a user-friendly address.

    Since Google’s research indicates your website’s bounce rate can increase by 32% if it loads between one and three seconds, it’s essential to shave off as much time as possible from page load speeds.

    Today, I’ll share more details on DNS testing and how you can run your DNS response time test to see if you can improve the performance of your DNS and website’s speed.

    What is a DNS?

    Domain Name Servers (DNSs) are like phone books for websites, linking them to their IP addresses. In turn, a DNS lookup is the process of finding the correct IP address for a given website URL. 

    Domain names such as “wp-rocket.me” require the assistance of DNS servers to translate the domain name into a numeric IP address so that users can access the right site.

    How do DNS Servers Work?

    Understanding how DNS servers work might help troubleshoot when you have DNS problems. For example, a number has a name and a number attached to it. The name is what people type into a browser to access a site, such as our website wp-rocket.me. 

    Numbers or IP addresses are associated with that domain name and indicate the location of the website on the internet. A DNS server’s job is to tie the name to the number.

    When a website’s name is put into the browser, it queries the nearest DNS server for its IP address. When the DNS server delivers the IP address, the browser connects to the webpage, which shows on your screen. Unfortunately, end users are unaware of the necessary background processes to keep the system running.

    If the DNS server is unavailable, the browser cannot get the website’s IP address and returns an error. Because it takes seconds for the news to spread, everyone knows the server is down.

    DNS Lookup Journey. Source

    Here’s a quick step by step process of how it works once you type in the domain name you want to visit:

    1. Requesting website information.
    2. It contacts the recursive DNS servers
    3. It looks for the authoritative DNS servers, or it looks elsewhere
    4. Access the DNS record
    5. Returns the record to your computer to your browser

    And entire DNS process takes only milliseconds to complete, and as a site owner, you want to reduce DNS lookup as much as possible.

    Two Methods And Two Very Different Tests

    The two methods are:

    1. Ping test
    2. Dig  test

    Site owners and developers commonly run ping tests to measure the average time for a site to load.

    While these tests give helpful information, they are not always trustworthy.

    Some servers consider pings to be unnecessary and do not respond to them. Unfortunately, when this occurs, you will be unable to generate data on how fast your site loads.

    Ping tests also don’t always disclose how quickly your DNS responds and fetches the IP address needed to load a page.

    This is when the BIND tool comes into play.

    It may be used to execute a DIG (Domain Information Groper) command to get your actual DNS response time.

    It comes with Mac and may be downloaded and installed on Windows.

    Using dig to test DNS server response time

    The DNS response time results show just one metric from your computer, and it is essential to conduct your tests from other locations to get more accurate findings. You may run further tests using Google’s Public DNS. 

    To run a DIG command and DNS response time test, go to your Applications folder on Mac and open the Terminal app.

    For Windows, go to Start > Run, enter “cmd” (without the quotation marks) into the field, and press Enter on your keyboard. Then, click on Command Prompt to open it.

    Next, type in the command in the link below, but don’t forget to replace “your-site.com” with your actual domain before pressing Enter on your keyboard:

    time dig example.com 

    Furthermore, you must enter the command in the link below, but remember to change your site’s domain with your actual domain before pressing Enter.

    In this case, we’re showing a result similar to the one shown below for the DNS response time test performed for Google. The real-time is recorded in minutes, then seconds, followed by a period and milliseconds during the test. 

    The query time is recorded to determine how long it takes for your computer to execute the command, whereas the real-time determines how long it takes for your computer to contact your site’s DNS.

    Using dig to test DNS server response time on mac
    DIG command and DNS response time test on Terminal App via Mac OS

    The results are identical to the previous commands, and you can get DNS response time by subtracting the real-time from the query time.

    Digging Deeper into a DNS Response Time Test

    The resulting DNS response time test shows only one metric from your computer. To get more accurate results, you must run tests from different locations.

    You can use Google’s Public DNS, for example, to run more tests.

    Go back to your Terminal app or Command Prompt and enter the following command:

    Don’t forget to replace “your-site.com” with your actual site address.

    The results are similar to the previous command, and you can subtract the real-time from the query time to get the DNS response time.

    You know how to test DNS server response time using the DIG command, but how reliable are your results, exactly?


    The Problem When You DIG for Results

    While the BIND tool and DIG commands are helpful, there are some caveats.

    Have No Fear, You’re (Probably) in the Clear

    Lighting-fast DNS speeds are significant, but that’s not the only factor you should consider when trying to improve your site’s performance.

    Many DNS options out there are sufficient. So unless you’re experiencing an alarmingly large DNS response time close to or much longer than a second for a small to medium-sized site, you’re probably in the clear.

    Although, this isn’t a hard and fast rule. Each site is different. It’s up to you to decide what’s an appropriate DNS response time since it will vary based on the purpose of your website.

    As Valuable as Your DNS’s Speed

    How quickly your site’s DNS performs isn’t the only factor you should consider. What’s equally critical is that your DNS is secure and reliable, and your provider acts ethically, professionally, and takes your privacy seriously.

    If security and privacy aren’t a priority for you, they should be since hackers can cause many issues for your site’s speed.

    For example, they could inject scripts that add spam to your site that increases load times or redirect your domain to point to their spam, malware, or phishing website.

    Hackers could redirect your domain to their phishing site compromising security and privacy.

    If your DNS isn’t reliable, it could be slow one minute, then fast another, and your visitors could get downright annoyed and decide to leave your site altogether.

    Similarly, your hosting provider should also help you with any DNS issues courteously and quickly. Otherwise, you could struggle with your site’s speed for the long haul.

    Possibly Skewed Results

    The DIG command does a DNS lookup, but only from your computer or another DNS of your choosing.

    Depending on how close your site’s DNS is to your computer or the DNS you used to run the test, you may not get accurate results for how your users experience your site’s speed.

    If you’re located near your DNS and server, you’re going to get much faster response times than a user from the other side of the world and vice versa.

    Not every one of your users will likely visit your site from your location. Unfortunately, that means some of your site’s visitors may experience higher or lower response times depending on how far they are away from your site’s DNS and server.

    Getting results from only one or two different DNS locations isn’t going to provide an accurate overview of the average DNS response time for your site.

    Ideally, Google’s Public DNS would be located on the opposite side of the world from your computer’s location, and your site’s DNS would be located near either you or the public DNS.

    In that case, your results wouldn’t be as limited.

    But, this may not be the case.

    Fortunately, there are automated tools you can use to get more accurate results when you test DNS server response time.

    Tools to Test DNS Server Response Time

    Both of the tools listed here are free to use and do not need any software installation. They are both dependable and secure, and they provide complete reports after each DNS response time test.

    DNSPerf

    DNSPerf website

    The DNSPerf tool performs real-time checks from over 30 locations to provide a comprehensive picture of how well your DNS performs worldwide.

    Each location is marked with the amount of time it took your DNS to reply, and bad timings are highlighted in yellow as a warning or in red to indicate significant speed difficulties.

    The results are given in list form and on a map for clarity.

    DNSPerf map dns vieew

    Probably the best tool, and that looks great. But you can also scroll down and see the list of locations and response times:

    DNSPerf result list

    DotCom-Tools

    DotCom-Tools website

    The DNS lookup test from DotCom-Tools asks root servers to obtain DNS lookup records that specify the path followed to acquire authoritative DNS server data. The IP addresses associated with the requested DNS record are returned by the DNS server. If IPv4 and IPv6 addresses are available, the DNS trace test will attempt to resolve them automatically.

    The ability to choose the countries you want to test a page’s load and response time on is an excellent option if you’re testing a specific area for your business. The time it takes to obtain a response from each node along the path, and the responses given from each node are included in the test results.

    DotCom-Tools results

    GRC DNS Benchmark

    GRC DNS Benchmark is a standalone tool provided for Windows and Linux to test local and remote name servers. You can compare the performance and reliability of up to 200 DNS resolvers with Cached/uncached/dotcom lookup. View the findings in tabular or graphical form or export the results to CSV format.

    GRC DNS Benchmark


    Wrapping Up

    In certain circumstances, shaving milliseconds – or seconds – off your DNS response time might drastically reduce your site’s load times. It will also aid in the improvement of the Largest Contentful Paint (LCP) grade, which is one of the Core Web Vitals.

    A DNS response time test using the DIG command can help you identify whether your DNS is operating properly or whether it needs to be improved.

    In any case, you’ll know if your DNS speed is enough.

    Do you test the response time of DNS servers? Have you considered your DNS while reviewing the overall performance of your site?

    The post How to Test DNS Server Response Time to Troubleshoot Site Speed appeared first on WP Rocket.