What Are The Best Practices For Optimizing Website Speed?

In today’s fast-paced digital landscape, ensuring your website loads quickly is essential for providing a seamless user experience. Slow-loading websites not only frustrate visitors but also have a negative impact on search engine rankings. So, what are the best practices for optimizing website speed? By implementing techniques such as minifying code, leveraging browser caching, optimizing images, and reducing server response time, you can significantly improve your website’s performance. In this article, we will explore these best practices and guide you on how to enhance your website’s speed, ultimately delivering a faster and more efficient browsing experience to your users.

Optimizing Images

Compressing Images

When it comes to optimizing website speed, one of the key factors to consider is image compression. Compressing images involves reducing their file size without compromising their quality. By doing so, you can significantly reduce the loading time of your website.

There are various tools available that can help you compress images effectively. These tools use different algorithms to eliminate unnecessary data from images, resulting in smaller file sizes. Some popular image compression tools include TinyPNG, JPEG Optimizer, and ImageOptim.

Using the Correct Image Format

Another important aspect of image optimization is using the correct image format. Different image formats have their own strengths and weaknesses in terms of file size and visual quality.

For photographs and images with complex designs, it is usually recommended to use JPEG or WebP format. These formats provide a good balance between file size and image quality. On the other hand, for images with simple designs or transparent backgrounds, PNG format is more suitable.

By choosing the correct image format for your website, you can ensure that your images are optimized for both file size and visual quality, resulting in faster load times.

Lazy Loading Images

Lazy loading is a technique that allows you to defer the loading of images until they are actually needed. This means that when a user visits your website, only the images visible within the viewport will be loaded initially. As the user scrolls down, more images will be loaded dynamically.

Implementing lazy loading can significantly improve the initial loading time of your website, especially if you have a large number of images or if the images are positioned below the fold. There are many JavaScript libraries and plugins available that can assist in implementing lazy loading, such as Intersection Observer API and Lazy Load XT.

Resizing Images

In addition to compressing images, resizing them to the appropriate dimensions can also contribute to optimizing website speed. If you are using large images on your website but displaying them in smaller dimensions, it is recommended to resize the images to match the required dimensions.

Resizing images not only reduces the file size but also improves the rendering time of the images. This is because the browser does not need to spend extra resources to resize the image on the fly to fit the display dimensions.

There are numerous image editing software and online tools available that can help you resize images effectively. By resizing images before uploading them to your website, you can ensure faster loading times and a smoother user experience.

Using a Content Delivery Network (CDN)

A Content Delivery Network (CDN) is a network of servers spread across different geographical locations. Its main purpose is to deliver content to users more efficiently by reducing the distance between the user’s device and the server.

By utilizing a CDN, you can improve the speed and performance of your website by caching your content on multiple servers around the world. When a user visits your website, the CDN will serve the content from the server that is closest to the user, resulting in reduced latency and faster load times.

CDNs also offer additional features such as automatic image optimization and compression, as well as security features like Distributed Denial of Service (DDoS) protection and Secure Sockets Layer (SSL) encryption.

Choosing a reliable and reputable CDN provider is crucial to ensure the best performance for your website. Some popular CDNs include Cloudflare, Amazon CloudFront, and Akamai.

Minimizing HTTP Requests

Combining Files

One of the most effective ways to minimize HTTP requests and optimize website speed is by combining files. This involves combining multiple JavaScript or CSS files into a single file, reducing the number of requests needed to load these resources.

By reducing the number of HTTP requests, you can significantly improve the loading time of your website. This is because each request incurs a certain amount of overhead, including DNS lookup, connection establishment, and data transfer.

There are various tools and techniques available to help you combine files effectively. For example, you can use task runners like Grunt or Gulp to automate the process of combining and minifying files. Additionally, some Content Management Systems (CMS) and plugins offer built-in functionality for combining files.

Reducing the Number of Scripts and Stylesheets

Another way to minimize HTTP requests is by reducing the number of scripts and stylesheets used on your website. Each script or stylesheet requires a separate HTTP request, so the more files you have, the longer it will take for your website to load.

One approach to reducing the number of scripts and stylesheets is to consolidate multiple files into a single file, as mentioned earlier. Additionally, you should also remove any unnecessary scripts or stylesheets that are not being used on your website. This can be done by auditing your code and identifying any redundant or unused files.

By reducing the number of scripts and stylesheets, you can improve the loading time of your website and enhance the overall user experience.

Using Inline CSS and JavaScript

Inline CSS and JavaScript refer to the practice of placing CSS and JavaScript code directly within the HTML file, instead of linking to external files. While this may not be suitable for large codebases, it can be a useful technique for optimizing website speed, especially for smaller websites or critical parts of a webpage.

By embedding CSS and JavaScript code directly in the HTML file, you can eliminate the need for additional HTTP requests to fetch external files. This can save valuable time in the loading process and improve the perceived speed of your website.

However, it is important to note that inline CSS and JavaScript can increase the file size of the HTML document and make it harder to maintain and update the code. Therefore, it should be used judiciously and in situations where the benefits outweigh the drawbacks.

Minifying CSS and JavaScript

Minification is the process of removing unnecessary characters, white spaces, and comments from CSS and JavaScript files. By doing so, you can reduce the file size of these resources and improve the loading time of your website.

There are various tools available that can automatically minify your CSS and JavaScript files. These tools remove any unnecessary characters and optimize the code to ensure that it can still be executed without any functional changes.

Minification is a simple yet effective technique for optimizing website speed, as it reduces the file size of CSS and JavaScript resources without compromising their functionality.

Caching

Leveraging Browser Caching

Browser caching involves storing certain resources, such as images, CSS files, and JavaScript files, in the user’s web browser. When the user visits your website again, the browser can load these resources from its cache instead of making a new HTTP request to the server.

By leveraging browser caching, you can significantly improve the loading time of your website for returning visitors. This is because the browser does not need to download the resources again, resulting in faster load times.

To enable browser caching, you can set appropriate cache control headers in your server configuration or by adding meta tags to your HTML files. These headers and tags specify the maximum amount of time the browser should keep the resources in its cache before checking for updates from the server.

Using Server-Side Caching

Server-side caching involves storing dynamically generated content, such as database queries or API responses, in the server’s memory or temporary storage. This can greatly reduce the processing time required to generate the same content for subsequent requests.

By implementing server-side caching, you can improve the performance and responsiveness of your website, especially for content that is relatively static or changes infrequently. This reduces the load on your server and allows it to handle more requests efficiently.

There are various caching mechanisms and technologies available for server-side caching, such as Redis, Memcached, and Object Caching in WordPress. These tools can help you cache data and improve the speed of your website.

Implementing Content Delivery Network (CDN) Caching

In addition to browser caching and server-side caching, you can also leverage caching capabilities offered by Content Delivery Networks (CDNs). CDNs typically have their own caching infrastructure that can cache your website’s static content, such as images, CSS files, and JavaScript files, across multiple servers worldwide.

When a user requests content from your website, the CDN can serve the cached content from the nearest server, resulting in faster load times and reduced latency. This is especially beneficial for websites with a global audience, as it ensures that users from different geographical locations can access your content quickly.

To implement CDN caching, you need to configure the caching settings provided by your CDN provider. This typically involves specifying the caching duration and the types of content that should be cached.

By leveraging CDN caching, you can improve the overall performance and accessibility of your website while reducing the load on your origin server.

Optimizing Code

Reducing Redirects

Redirects occur when a user requests a web page that has been moved to a different URL. While redirects are sometimes necessary for various reasons, such as URL changes or site structure updates, they can negatively impact website speed.

Each redirect requires an additional round trip to the server, resulting in increased latency and longer loading times. Therefore, it is important to minimize the number of unnecessary redirects on your website.

You can reduce the number of redirects by ensuring that your URLs are consistent and do not change frequently. Additionally, you should regularly audit your website to identify any unnecessary redirects and update them to the correct URLs.

By minimizing redirects, you can improve the speed and efficiency of your website, providing a better user experience for your visitors.

Eliminating Render-Blocking Resources

Render-blocking resources are CSS or JavaScript files that block the rendering of a webpage until they are fully loaded and executed. When a browser encounters a render-blocking resource, it stops parsing the HTML and waits for the resource to be fetched and processed.

Render-blocking resources can significantly impact website speed and user experience, especially if they are large or take a long time to load. To optimize website speed, it is important to identify these render-blocking resources and eliminate or minimize their impact on the rendering process.

One way to eliminate render-blocking resources is by optimizing the critical rendering path. This involves identifying the CSS and JavaScript files that are required for the initial rendering of the webpage and loading them asynchronously or inline within the HTML.

Additionally, you can also use techniques like code splitting and lazy loading to load non-critical resources after the initial rendering. By doing so, you can ensure that the webpage appears quickly to the user, enhancing the perceived speed of your website.

Deferring JavaScript Execution

JavaScript is a powerful scripting language that can enhance the functionality and interactivity of your website. However, if JavaScript files are not optimized and loaded properly, they can slow down the loading time of your website.

One technique to optimize JavaScript loading is by deferring its execution. This means that instead of executing the JavaScript code immediately when it is encountered, it is loaded in the background and executed after the rest of the webpage has finished loading.

By deferring JavaScript execution, you can prevent JavaScript from blocking the rendering of the webpage, allowing the browser to display the content faster. This is particularly beneficial for websites with complex JavaScript functionality or large JavaScript files.

To defer JavaScript execution, you can use the defer attribute in the HTML script tag or use JavaScript techniques like the DOMContentLoaded event or the async attribute.

Asynchronous Loading

In addition to deferring JavaScript execution, you can also load JavaScript files asynchronously. Asynchronous loading allows the browser to fetch and load JavaScript files in the background while continuing to parse and render the rest of the webpage.

By loading JavaScript asynchronously, you can further improve the loading time of your website, as the browser does not need to wait for JavaScript files to be fully loaded before displaying the content.

To load JavaScript asynchronously, you can use the async attribute in the HTML script tag. However, it is important to note that asynchronous loading can sometimes lead to unpredictable execution order, so it should be used carefully, especially for code that depends on specific execution sequences.

Gzip Compression

Gzip compression is a technique that involves compressing files on the server before sending them to the user’s browser. This reduces the file size of the response and improves the speed of content delivery.

By enabling Gzip compression, you can significantly reduce the size of text-based files, such as HTML, CSS, and JavaScript, as well as XML and JSON files. This results in faster load times and reduced bandwidth usage for your website.

Most modern web servers and Content Management Systems (CMS) have built-in support for Gzip compression. You can usually enable Gzip compression by modifying your server configuration or using plugins or extensions provided by your CMS.

Enabling Gzip compression is a highly effective technique for optimizing website speed, as it can greatly reduce the amount of data transferred between the server and the browser.

Optimizing Database

Cleaning and Optimizing the Database

Regularly cleaning and optimizing your database can have a significant impact on website speed. Over time, databases can accumulate unnecessary data, such as spam comments, post revisions, and expired transient data, which can increase the size and slow down the performance of your database.

By cleaning and optimizing your database, you can remove unnecessary data and free up storage space. This can improve the efficiency of database operations, resulting in faster queries and overall better website performance.

There are various plugins and tools available that can help you clean and optimize your database. These tools can identify and remove unnecessary data, as well as optimize the database structure and indexes to improve query performance.

Reducing the Number of Database Queries

Another way to optimize database performance and improve website speed is by reducing the number of database queries. Each query made to the database incurs a certain amount of overhead, so minimizing the number of queries can significantly improve the loading time of your website.

One approach to reducing the number of database queries is by optimizing the queries themselves. This involves analyzing the queries used in your website and identifying any inefficient or redundant queries. By optimizing these queries, you can reduce the execution time and improve the overall performance of your website.

Additionally, you can also implement caching mechanisms, such as object caching or database query caching, to further reduce the need for frequent database queries. Caching can store the results of frequently executed queries in memory, allowing subsequent requests to be served faster without accessing the database.

By reducing the number of database queries, optimizing their execution, and implementing caching mechanisms, you can significantly improve the speed and efficiency of your website.

Implementing Database Caching

Database caching is a technique that involves storing the results of frequently executed database queries in memory. By caching query results, you can reduce the need for repeated database access, resulting in faster load times and improved website performance.

There are various caching plugins and tools available for popular Content Management Systems (CMS) like WordPress, Drupal, and Joomla. These plugins can implement database caching mechanisms, such as object caching or query caching, and improve the speed of your website.

Additionally, you can also use caching plugins or tools that provide full-page caching capabilities. Full-page caching involves storing the entire HTML output of a webpage, including its content and layout, in memory or on disk. When a user requests the same webpage, the cached version is served directly, bypassing the need for database access and dynamic content generation.

By implementing database caching and full-page caching, you can significantly improve the loading time of your website and enhance the overall user experience.

Using a Content Delivery Network (CDN)

Understanding CDNs

A Content Delivery Network (CDN) is a distributed network of servers strategically located across different geographical regions. The main purpose of a CDN is to deliver content to users more efficiently and reliably by reducing the distance between the user’s device and the server.

A CDN works by caching your website’s static content, such as images, CSS files, and JavaScript files, on multiple servers distributed worldwide. When a user visits your website, the CDN serves the content from the server that is geographically closest to the user, resulting in reduced latency and faster load times.

CDNs also offer additional features such as automatic image optimization and compression, as well as security features like Distributed Denial of Service (DDoS) protection and Secure Sockets Layer (SSL) encryption.

Benefits of Using a CDN

There are several benefits of using a CDN to optimize your website speed. Firstly, a CDN reduces the distance between the user and the server, minimizing the latency and improving the speed of content delivery. This is particularly beneficial for websites with a global audience, as it ensures that users from different geographical locations can access your content quickly.

Secondly, CDNs can handle high traffic loads and distribute the load across multiple servers. This helps to improve the scalability and reliability of your website, as the CDN can automatically route traffic to the server with the lowest load or best performance.

Thirdly, CDNs can offload the bandwidth and server resources from your origin server. By caching your website’s static content on the CDN servers, you can reduce the amount of data transferred between your origin server and the user’s browser. This can save valuable server resources and reduce bandwidth costs, especially for websites with large files or heavy traffic.

Lastly, CDNs offer additional features such as automatic image optimization and compression. These features can further improve the performance and loading time of your website by reducing the file size of your images and other static content.

Selecting the Right CDN for Your Website

When selecting a CDN for your website, there are several factors to consider. Firstly, you should evaluate the network coverage and geographical reach of the CDN. Ensure that the CDN has servers located in regions where your target audience is located, as this will lead to faster load times for your users.

Secondly, consider the scalability and performance capabilities of the CDN. Evaluate the CDN’s ability to handle high traffic loads and distribute the load across multiple servers. Additionally, assess the CDN’s performance in terms of latency, uptime, and response time.

Thirdly, consider the additional features and services offered by the CDN. Some CDNs offer advanced caching mechanisms, automatic image optimization, security features, and analytics and reporting tools. Assess these features and determine if they align with your website’s requirements.

Lastly, consider the pricing and cost structure of the CDN. CDNs typically charge based on factors such as bandwidth usage, storage, and additional features. Evaluate your website’s traffic volume and projected growth to determine the cost of using the CDN.

Overall, selecting the right CDN is crucial to ensure the best performance for your website. Consider your website’s requirements, target audience, and budget when choosing a CDN provider.

Enabling Browser Caching

Setting Browser Cache Expiry Headers

Browser caching involves storing certain resources, such as images, CSS files, and JavaScript files, in the user’s web browser. When the user visits your website again, the browser can load these resources from its cache instead of making a new HTTP request to the server.

To enable browser caching, you need to set appropriate cache expiry headers for your resources. These headers specify how long the browser should keep the resources in its cache before checking for updates from the server.

For static resources that rarely change, such as images, CSS files, and JavaScript files, you can set a long cache expiry time. This tells the browser to store the resources in its cache for a specified period, such as several days or weeks.

However, for dynamic resources that frequently change, such as HTML pages or API responses, it is recommended to set a shorter cache expiry time or mark the resources as “no-cache”. This ensures that the browser always checks for updates from the server before displaying the content.

You can set cache expiry headers by modifying your server configuration or by adding meta tags or HTTP response headers to your HTML files. Most modern web servers and Content Management Systems (CMS) have built-in support for setting cache expiry headers.

Avoiding URL-based Cache Busting

URL-based cache busting is a technique where the URL of a resource is modified whenever the resource changes. This is often done by appending a version or timestamp parameter to the URL.

While cache busting can ensure that the latest version of a resource is always served, it can also lead to unnecessary cache invalidation and additional HTTP requests. Each time the URL of a resource changes, the browser considers it a new resource and needs to download it again.

To optimize website speed, it is recommended to avoid URL-based cache busting whenever possible. Instead, rely on cache expiry headers to control the caching behavior of your resources. This allows the browser to cache the resources for an extended period without the need for unnecessary cache invalidation.

If you need to ensure that the latest version of a resource is always served, you can use techniques like cache busting through file versioning or content-based cache busting. These techniques involve modifying the filename or content of the resource when it changes, instead of changing the URL.

By avoiding URL-based cache busting and relying on cache expiry headers, you can optimize the caching behavior of your website and ensure faster load times for your users.

Reducing Server Response Time

Choosing the Right Web Hosting Provider

The server response time, also known as Time to First Byte (TTFB), is the time it takes for the server to respond to a request from the user’s browser. A slow server response time can significantly impact website speed and user experience, as it delays the rendering of the webpage.

When optimizing server response time, one of the key factors to consider is the choice of web hosting provider. The performance and reliability of the server infrastructure provided by the hosting provider can have a significant impact on the server response time of your website.

When selecting a web hosting provider, consider factors such as server specifications, network connectivity, data center locations, and customer reviews. Ensure that the hosting provider has modern server hardware, fast and stable network connections, and data centers located in regions that are close to your target audience.

Additionally, it is important to choose a hosting plan that is tailored to the needs of your website. Shared hosting plans, for example, can be cost-effective but may have limitations in terms of server resources and performance. If your website receives high traffic or requires advanced functionality, consider upgrading to a VPS (Virtual Private Server), cloud hosting, or dedicated server plan.

By choosing the right web hosting provider and plan, you can ensure that your website is hosted on a reliable and high-performance server infrastructure, resulting in faster server response times and improved website speed.

Optimizing Server Resources

Another way to reduce server response time and optimize website speed is by optimizing the server resources used by your website. This involves analyzing and optimizing various components of the server stack, such as the database, web server software, caching mechanisms, and server configuration.

One approach to optimizing server resources is by fine-tuning the server software and configurations. By optimizing settings like memory allocation, file compression, and caching mechanisms, you can improve the efficiency and performance of the server.

Additionally, you should also ensure that your server software and technologies are up to date. Regularly update the server software, such as the operating system, web server software, and database management system, to take advantage of the latest performance improvements and security patches.

Furthermore, consider implementing server-level caching mechanisms, such as object caching or opcode caching. These mechanisms can store frequently used data or compiled PHP code in memory, reducing the need for repetitive database access or script interpretation.

By optimizing server resources, you can reduce the processing time required to handle user requests, resulting in faster server response times and improved website speed.

Implementing Caching and CDNs

Caching and Content Delivery Networks (CDNs) can also play a crucial role in reducing server response time and optimizing website speed.

Server-side caching involves storing dynamically generated content, such as database queries or API responses, in the server’s memory or temporary storage. This reduces the processing time required to generate the same content for subsequent requests, resulting in faster server response times.

Additionally, CDNs can offload the bandwidth and server resources from your origin server by caching your website’s static content. By serving the content from the nearest CDN server, CDNs reduce the distance between the user and the server, resulting in reduced latency and faster load times.

By implementing server-side caching and utilizing CDNs, you can reduce the workload on your server, improve server response times, and enhance the overall performance of your website.

Using Gzip Compression

Understanding Gzip Compression

Gzip compression is a technique that involves compressing files on the server before sending them to the user’s browser. This reduces the file size of the response and improves the speed of content delivery.

Gzip compression works by replacing repeated strings within a file with shorter symbols. This essentially reduces the redundancy and eliminates unnecessary data, resulting in smaller file sizes. When the compressed file is sent to the user’s browser, it is decompressed and rendered as normal.

Gzip compression is particularly effective for text-based files, such as HTML, CSS, JavaScript, XML, and JSON files. These files typically contain a lot of repeated strings and white spaces, making them ideal candidates for compression.

Enabling Gzip Compression

Enabling Gzip compression on your server is relatively straightforward and can have a significant impact on website speed. Most modern web servers, such as Apache and Nginx, have built-in support for Gzip compression.

To enable Gzip compression, you need to modify your server configuration file. For example, in Apache, you can add the following lines to your .htaccess file or the server configuration file:

 SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/css application/javascript application/x-javascript text/javascript text/plain text/xml image/svg+xml  

These lines instruct the server to compress specific file types, such as HTML, CSS, and JavaScript, before sending them to the user’s browser.

In Nginx, you can add the following lines to your nginx.conf file or the server configuration file:

gzip on; gzip_vary on; gzip_types text/html text/css application/javascript application/x-javascript text/javascript text/plain text/xml image/svg+xml; 

These lines enable Gzip compression and specify the file types that should be compressed.

After enabling Gzip compression, you should test your website using online tools or browser extensions to ensure that the compression is working correctly. These tools can analyze the response headers and content to verify that Gzip compression is being applied.

By enabling Gzip compression, you can reduce the file size of text-based files, improve the speed of content delivery, and enhance the overall performance of your website.

Minimizing CSS and JavaScript

Consolidating Multiple Files

One effective way to minimize CSS and JavaScript files and optimize website speed is by consolidating multiple files into a single file. This involves combining all the CSS or JavaScript files used on your website into one file, reducing the number of HTTP requests needed to load these resources.

By reducing the number of HTTP requests, you can significantly improve the loading time of your website. Each request incurs a certain amount of overhead, including DNS lookup, connection establishment, and data transfer. Therefore, if you can combine multiple files into a single file, you can save valuable time in the loading process.

To consolidate CSS and JavaScript files, you can use task runners like Grunt or Gulp, which automate the process of combining and minifying files. Additionally, some Content Management Systems (CMS) and plugins offer built-in functionality for consolidating files.

However, it is important to note that consolidating files may introduce complexity, especially when multiple developers are working on the same codebase. Therefore, it is important to establish proper version control and coding standards to ensure smooth collaboration and minimize conflicts.

Removing Unused Code

Removing unused code is another important practice for optimizing CSS and JavaScript files. Over time, your codebase may accumulate redundant or unused code that is no longer necessary for the functionality of your website.

By removing unused code, you can reduce the file size of your CSS and JavaScript files, resulting in faster load times and improved website speed. Additionally, removing unused code also improves the maintainability and readability of your codebase.

There are various tools available that can help you identify unused code in your CSS and JavaScript files. These tools analyze your codebase and highlight any code that is not being used or referenced.

Additionally, you should also regularly audit your codebase and perform a manual review to identify any redundant or unused code. This can be done by examining your stylesheets and scripts, as well as inspecting the HTML files to ensure that all references to stylesheets and scripts are valid and necessary.

By removing unused code, you can optimize your CSS and JavaScript files, reduce the file size, and improve the loading time of your website.

Using External Files

Using external files for your CSS and JavaScript resources can also contribute to optimizing website speed. External files, such as stylesheets and script files, allow the browser to cache the resources separately and reuse them across multiple pages.

By using external files, you can take advantage of browser caching and reduce the number of HTTP requests needed to load your website. When a user visits your website for the first time, the browser can cache the external files and reuse them for subsequent requests, resulting in faster load times.

To use external files, you need to link to the files from your HTML document using the appropriate HTML tags. For example, to link to an external CSS file, you can use the following HTML code:

 

Similarly, to link to an external JavaScript file, you can use the following HTML code:

 

By using external files, you can optimize the caching behavior of your CSS and JavaScript resources, improve website speed, and enhance the overall user experience.

Loading CSS and JavaScript Asynchronously

Loading CSS and JavaScript files asynchronously is another technique that can improve website speed and user experience. Asynchronous loading allows the browser to fetch and load CSS and JavaScript files in the background while continuing to parse and render the rest of the webpage.

By loading CSS and JavaScript files asynchronously, you can prevent these files from blocking the rendering of the webpage, allowing the browser to display the content faster. This is particularly beneficial for websites with complex or large CSS and JavaScript files.

To load CSS and JavaScript files asynchronously, you can use the async attribute in the HTML script and link tags. For example, to load an external JavaScript file asynchronously, you can use the following HTML code:

 

Similarly, to load an external CSS file asynchronously, you can use the following HTML code:

  

By loading CSS and JavaScript files asynchronously, you can further improve the loading time of your website and enhance the overall user experience.

In conclusion, optimizing website speed is crucial for providing a great user experience and improving overall website performance. By following the best practices outlined in this article and implementing techniques such as image compression, file consolidation, caching, and server optimization, you can ensure that your website loads quickly and efficiently, keeping your visitors happy and engaged.