10 Ways to Reduce HTTP Requests in WordPress: Boost Your Site’s Performance
In the fast-paced digital landscape, every second counts—especially when it comes to your website’s loading speed. If you’re running a WordPress site, you might find that excessive HTTP requests can bog down your site’s performance, leading to sluggish loading times and a frustrating user experience. But fear not! In this listicle, we’ll explore 10 effective strategies to help WordPress make fewer HTTP requests, enhancing both your site’s speed and overall efficiency.
From optimizing images to leveraging caching plugins, each method is designed to streamline the way your WordPress site communicates with the server, ultimately improving performance and user satisfaction. Whether you’re an experienced developer or a WordPress newbie, this guide will provide you with actionable insights and practical steps to reduce the number of HTTP requests your site makes, ensuring it runs smoothly like a well-oiled machine. Dive in and discover how you can create a faster, more efficient WordPress experience for your visitors!
1) Optimize Your Images
Image Optimization Techniques
To truly enhance the performance of your WordPress site and make fewer HTTP requests, optimizing your images is crucial. Images can consume a significant amount of bandwidth, which may lead to slower load times. By implementing effective image optimization strategies, you can streamline your site’s performance, boost its SEO, and provide a better user experience.
Choosing the Right Format
Selecting an appropriate image format is a fundamental step in reducing file sizes without sacrificing quality. Here are some commonly used formats:
- JPEG: Ideal for photographs, balancing quality and file size.
- PNG: Best for images requiring transparency but larger in size.
- GIF: Perfect for simple graphics and animations; however, it can be limited in color depth.
- WebP: An advanced format that often provides superior compression while maintaining quality.
Each format has its strengths, and using the right one can significantly reduce the number of HTTP requests as well as the loading time.
Compressing Your Images
Another effective method is compressing your images. This tactic minimizes the image file size, effectively reducing the number of HTTP requests and improving your site’s loading speed. A few popular compression tools include:
- WP Smush: A plugin that automatically compresses images as you upload them.
- EWWW Image Optimizer: This plugin can optimize images already on your site as well.
- ShortPixel: Offers bulk optimization and maintains quality after compression.
By adopting one of these plugins, you ensure your images are not bloated, which contributes to a leaner site and fewer HTTP requests.
Responsive Images
In today’s multi-device world, responsive images are essential. By utilizing the HTML `srcset` attribute, you can serve different image sizes based on the user’s device. This means smaller images will load on mobile devices, thereby consuming less bandwidth and making fewer HTTP requests. Consider the following table as a guide to implementing responsive images:
Device Type | Image Size (px) |
---|---|
Desktop | 1200 |
Tablet | 800 |
Mobile | 400 |
With the above approach, not only do you ensure a faster site, but you also improve your SEO rankings as search engines favor sites that enhance user experience.
Lazy Loading Images
Lastly, consider implementing lazy loading for your images. This technique loads images only when they are about to enter the viewport, eliminating the need for all images to be fetched during the initial HTTP request. Various plugins such as a3 Lazy Load or Lazy Load by WP Rocket can simplify this implementation. Lazy loading keeps your site lighter, faster, and ultimately reduces the total number of HTTP requests made.
Having an image optimization strategy in place will not only boost your site’s speed and efficiency but will also contribute significantly to your overall SEO strategy, ultimately resulting in improved organic traffic.
2) Enable Browser Caching
Understanding Browser Caching
When a user visits your WordPress website, their browser downloads various resources, such as images, stylesheets, and JavaScript files. This process generates HTTP requests for each of these resources. By enabling browser caching, you allow returning visitors to load your website faster, as their browser can store these resources locally and avoid redundant requests on subsequent visits.
Why This Matters
Every HTTP request can introduce latency, thereby slowing down your site’s performance. In a world where speed matters, reducing the number of requests helps improve user experience and decreases bounce rates. Better page load speeds also positively affect search engine rankings, since search engines prioritize fast-loading sites. Enabling browser caching is a powerful yet often overlooked tactic in the quest to optimize your WordPress site.
How to Enable Browser Caching
There are several methods to enable browser caching effectively:
- Edit .htaccess File: For Apache servers, you can enable caching by adding specific configurations to your .htaccess file. Below is a simple configuration snippet:
# Enable browser caching
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
- Use a Caching Plugin: Leveraging popular optimization plugins like W3 Total Cache or WP Super Cache can simplify the process. These plugins often have built-in settings to help manage browser caching without additional coding.
- Content Delivery Network (CDN): By using a CDN, cached copies of your site’s resources are stored on servers around the world. This not only reduces the number of HTTP requests but also improves load times for users who are geographically distant from your primary server.
Best Practices for Setting Cache Expiry
When enabling browser caching, it’s essential to define appropriate cache expiry durations. Here’s a concise table summarizing common cache times for various types of resources:
Resource Type | Recommended Cache Time |
---|---|
Images | 1 month |
CSS Files | 1 month |
JavaScript Files | 1 month |
HTML Files | 1 day |
By strategically implementing browser caching, you can significantly reduce the number of HTTP requests made by your WordPress site, leading to optimal performance and a better user experience. Remember that as you make changes to your resources, updating cache settings and time frames will help maintain the balance between speed and current content delivery.
3) Use a Content Delivery Network (CDN)
Why a CDN Can Transform Your WordPress Performance
A Content Delivery Network (CDN) is a network of servers strategically located around the globe, designed to reduce the physical distance between your users and the resources they need. When you implement a CDN, your content is cached on these distributed servers, allowing users to access it from the closest location. This not only enhances load times but also significantly reduces the number of HTTP requests made to your WordPress site.
How CDNs Minimize HTTP Requests
When your site utilizes a CDN, static resources like images, JavaScript, and CSS files are served from the CDN rather than your main hosting server. This results in:
- Decreased Server Load: By offloading the delivery of static content, your server can focus on processing dynamic requests, effectively managing traffic.
- Fewer Round Trips: Users experience fewer HTTP requests as content is delivered from various edge servers rather than relying solely on your origin server.
- Better Caching Practices: CDNs manage versioning and caching strategies, refreshing content efficiently without overwhelming your server.
Choosing the Right CDN Provider
Selecting an optimal CDN provider is crucial for minimizing HTTP requests effectively. Here are some popular options with unique features:
CDN Provider | Key Features | Pricing |
---|---|---|
Cloudflare | Free SSL, Web Application Firewall (WAF) | Free tier, Paid plans start at $20/month |
Akamai | Enterprise-level security, Global reach | Custom pricing based on usage |
Amazon CloudFront | Integration with AWS services, Pay-as-you-go | Pay-per-use pricing |
Integrating a CDN with Your WordPress Site
Implementing a CDN on your WordPress site is straightforward. Most CDN services provide plugins or integrations that simplify the setup process. Here’s how you can do it:
- Choose a CDN provider and sign up.
- Install the relevant WordPress plugin (most popular providers offer dedicated plugins).
- Follow the plugin setup instructions to configure your CDN settings.
- Test your site to verify that content is correctly served via the CDN.
Incorporating a CDN can be a game-changer in your mission to make fewer HTTP requests on your WordPress site. By leveraging the advantages of a CDN, you’re not just optimizing performance; you’re also enhancing user experience, which can lead to increased engagement and conversions.
4) Minify CSS and JavaScript Files
Understanding CSS and JavaScript Minification
To enhance the performance of your WordPress site, it’s crucial to minify your CSS and JavaScript files. Minification is the process of removing unnecessary characters from code without affecting its functionality. This includes removing whitespace, comments, and redundant code. As a result, minified files are smaller in size, which leads to faster load times and fewer HTTP requests.
The Benefits of Minification
When you minify CSS and JavaScript files, you primarily achieve two outcomes:
- Reduced File Size: Smaller files mean quicker downloads from the server, allowing your website to load more quickly for users.
- Improved Performance: With less data to transfer, your server responds faster, leading to a smoother browsing experience.
Implementing minification on your WordPress site not only contributes to a decrease in HTTP requests but also fosters a better user experience, directly impacting your SEO rankings.
How to Minify CSS and JavaScript Files
There are several effective methods to achieve minification on your WordPress site:
- Use Plugins: Numerous plugins can automatically minify CSS and JavaScript files upon activation. Some popular choices include WP Rocket, Autoptimize, and W3 Total Cache.
- Manually Minification: You can use tools like
File Type Original Size Minified Size CSS 50 KB 20 KB JavaScript 70 KB 30 KB In the example above, minifying both CSS and JavaScript files can lead to a saving of up to 50% in file size. This reduction significantly decreases the number of HTTP requests, allowing your web pages to render faster.
Final Thoughts
Incorporating minification into your WordPress strategy is an essential step in optimizing your site for performance. By lowering the size of your CSS and JavaScript files, you not only reduce HTTP requests but also provide a faster browsing experience for your visitors, ultimately improving your site’s search engine ranking. Make sure to regularly monitor and update your minification practices as your website evolves.
5) Limit External HTTP Requests
Understanding the Impact of External HTTP Requests
External HTTP requests can significantly affect the performance of your WordPress website. Every time a visitor loads your site, each external request can slow down the loading time, which might lead to a poor user experience and higher bounce rates. It’s essential to evaluate and limit these requests to optimize your site’s speed and performance.
Why Limit External HTTP Requests?
Limiting external HTTP requests is crucial for several reasons:
- Improved Loading Speed: Reducing the number of requests can drastically decrease the loading time of your site. Faster websites tend to retain visitors and rank better on search engines.
- Enhanced Security: Fewer external requests mean less exposure to potential vulnerabilities from third-party scripts or services.
- Better Resource Management: Minimizing requests reduces the load on your server, freeing up resources for other tasks, thus enhancing overall performance.
Strategies to Limit External HTTP Requests
To successfully limit external HTTP requests, consider implementing these strategies:
- Consolidate Scripts and Styles: Instead of linking to multiple stylesheets and scripts, combine them into a single file. This reduces the number of requests and improves loading time.
- Host Resources Locally: If you’re using resources from external sources, consider downloading and hosting them on your server. This cuts down on the need for additional requests to external sites.
- Use a Content Delivery Network (CDN): While CDNs do involve some external requests, they often streamline them, allowing your visitors to experience faster loading times worldwide.
- Evaluate Plugins: Regularly review your installed plugins. Some may make multiple external requests that are unnecessary. Remove or replace heavy plugins with more efficient alternatives.
Table of Common External Requests
Resource Type Example Recommendation Fonts Google Fonts Host locally or reduce font weights JavaScript Libraries jQuery from CDN Host locally or combine scripts Tracking Scripts Google Analytics Asynchronous loading or use a plugin for optimization CSS Frameworks Bootstrap Include only necessary components By strategically limiting external HTTP requests, you can significantly enhance your WordPress site’s performance, resulting in a better user experience and improved search engine rankings. Embrace these practices to make your site faster and more efficient.
6) Disable Unused Plugins
Identifying Unused Plugins
One of the most effective strategies for optimizing your WordPress website and reducing HTTP requests is to disable unused plugins. Many website owners accumulate a variety of plugins over time, but not all of them are actively utilized. Left unmonitored, these inactive plugins can still bloat your website, contribute to unnecessary HTTP requests, and pose security risks.
Steps to Identify and Disable
Follow these simple steps to identify and disable plugins that are not contributing to your site’s functionality:
- Log in to your WordPress Dashboard: Navigate to the Plugins section to view all installed plugins.
- Evaluate Active vs. Inactive Plugins: Take note of which plugins are inactive and assess whether they are necessary.
- Research Plugin Usage: Check the features of each inactive plugin to determine if they provide any value to your site.
- Testing Deactivation: Deactivate plugins one at a time and monitor your site’s performance.
Potential Benefits of Disabling Unused Plugins
By disabling unused plugins, you not only clean up your WordPress installation but also enhance the overall performance of your website. Here are some key benefits to consider:
- Enhanced Speed: Fewer active plugins mean fewer HTTP requests, leading to swift page loads.
- Improved Security: Inactive plugins can be potential vulnerabilities; disabling them reduces your exposure to security threats.
- Reduced Server Load: Every plugin adds a layer of complexity to your site; reducing the number optimizes resource usage.
Best Practices for Plugin Management
To maintain an optimal WordPress environment, consider the following best practices for managing plugins:
- Regular Audits: Periodically review your installed plugins to ensure their relevance and performance.
- Limit Plugin Usage: Always ask yourself if you really need a plugin before installation.
- Keep Updated: Ensure that active plugins are regularly updated to avoid security vulnerabilities.
A Note on Quality Over Quantity
Choosing high-quality plugins that serve multiple purposes can also be beneficial. Instead of installing several plugins that perform minor functions, look for comprehensive solutions. This approach minimizes the number of HTTP requests a page generates—and ultimately, enhances the end-user experience.
Summary of Impact
The impact of disabling unused plugins can be substantial. Below is a table summarizing the effectiveness of this approach:
Action Expected Outcome Disable Unused Plugins Reduced HTTP Requests Regular Plugin Audits Improved Performance Choose Quality Plugins Enhanced Security By focusing on the strategy of disabling unused plugins, you can significantly contribute to reducing the overall number of HTTP requests generated by your WordPress site, leading to a faster and more secure browsing experience for your visitors.
7) Implement Lazy Loading
Understanding Lazy Loading
Lazy loading is a design pattern that delays the loading of non-essential resources at the point they are needed, rather than on initial page load. This technique becomes crucial when optimizing your WordPress site for better performance and reducing HTTP requests. By preventing the browser from downloading images, videos, and other assets until they are needed, you can significantly enhance site load times.
Benefits of Lazy Loading
- Improved Performance: By reducing the amount of content that loads initially, lazy loading minimizes the overall load time of your pages.
- Reduced Bandwidth Usage: Only the images and resources that users actually scroll to will be loaded, leading to decreased bandwidth consumption.
- Enhanced User Experience: A faster loading site increases user satisfaction, often leading to lower bounce rates and higher engagement levels.
How to Implement Lazy Loading in WordPress
There are a few different methods to integrate lazy loading into your WordPress site. Here’s how you can effectively implement it:
- Use Built-in WordPress Feature: Starting from WordPress 5.5, an automatic lazy loading feature for images is included. This means that any images added to your posts will be loaded only as users scroll down the page.
- Plugins: For more advanced options, numerous plugins can enhance lazy loading capabilities. Some popular choices include:
Plugin Name Description WP Rocket A comprehensive optimization plugin that includes classic lazy loading features. A3 Lazy Load Offers lazy loading solutions for images, videos, iframes, and more. Lazy Load by WP Rocket A lightweight option specifically for lazy loading without additional performance overhead. Additional Considerations
When implementing lazy loading, keep in mind a couple of vital points:
- SEO Implications: Ensure that search engines can still crawl your content effectively. Use the
loading="lazy"
attribute in image tags, which is recognized by major search engines. - Testing: After implementing lazy loading, test your website’s performance using tools like GTmetrix or Google PageSpeed Insights to measure improvements in loading times and reduced HTTP requests.
By cleverly employing lazy loading on your WordPress site, you can not only enhance performance but also create a more engaging user experience, allowing you to focus more on relevant content than on slow load times and excessive HTTP requests.
8) Use a Lightweight Theme
Choosing the Right Theme for Optimal Performance
When it comes to minimizing HTTP requests on your WordPress site, selecting a lightweight theme can make a world of difference. Lightweight themes are designed with efficiency in mind, ensuring that your website loads faster and reduces the number of server calls required to render a page. Unlike heavier themes, which may be packed with features but slow down performance, lightweight options prioritize simplicity and speed.
Features of a Lightweight Theme
A good lightweight theme generally has the following characteristics:
- Minimalist Design: Less visual clutter translates to fewer elements loaded on the page.
- Optimized Code: Clean, efficient coding can significantly reduce HTTP requests.
- Responsive Layout: Ensures that the theme adapts to different screen sizes without additional resource load.
- Built-in Features: Comes with essential functionalities like SEO optimization, reducing the need for external plugins.
By focusing on these elements, lightweight themes can streamline your site’s performance. You’ll notice fewer HTTP requests as many crucial functionalities are integrated directly into the theme rather than relying on additional plugins, which typically increase the number of requests made to the server.
Choosing the Right Lightweight Theme
When selecting a lightweight theme for your WordPress site, consider the following:
Theme Name Page Load Time Number of HTTP Requests Astra 0.5s 32 GeneratePress 0.4s 28 Neve 0.6s 30 Selecting a theme that not only looks good but also performs optimally can greatly improve your site’s responsiveness. Use tools like GTmetrix or Google PageSpeed Insights to evaluate potential themes before making your decision.
Impacts on SEO and User Experience
Utilizing a lightweight theme directly influences both your SEO rankings and user experience. With fewer HTTP requests, your website can achieve faster load times, which is a critical factor for search engine algorithms and user satisfaction. When pages load quicker, users are likely to stay longer, reducing bounce rates—an important metric for SEO success.
Moreover, seamless navigation improves user engagement, leading to increased interactions and potentially higher conversion rates. As search engines favor websites that offer superior user experiences, optimizing with a lightweight theme becomes a strategic move for anyone serious about building their online presence efficiently. Choosing the right theme aligns with your goal to improve the speed and performance of your WordPress site while effectively minimizing HTTP requests.
9) Utilize a Caching Plugin
Why Caching is Essential for Your WordPress Site
Using a caching plugin is one of the most effective strategies to optimize your WordPress website, as it directly contributes to reducing HTTP requests. By storing a static version of your webpage, caching plugins minimize the amount of data that needs to be retrieved from the server for each request. This not only enhances site speed but also improves user experience and lowers server load, making your site more efficient and responsive.
How Caching Works
Caching plugins work by temporarily storing copies of your site’s content and serving these cached files to users, rather than processing more complex database queries on each page load. This process can significantly decrease the number of HTTP requests and the overall loading time of your website. Here are some essential functions of caching plugins:
- Page Caching: Saves the fully rendered HTML of your pages and posts.
- Browser Caching: Encourages visitors’ browsers to store elements locally for faster subsequent loads.
- Object Caching: Keeps database query results for faster retrieval on repeated requests.
- Minification: Reduces the size of CSS and JavaScript files, streamlining the content delivery.
Popular Caching Plugins to Consider
When you decide to install a caching plugin, it’s vital to choose one that suits your needs. Below is a comparison table of some of the top caching plugins available for WordPress:
Plugin Features Type of Caching Pros WP Super Cache Easy setup, CDN support Page caching Simplistic for beginners W3 Total Cache Comprehensive settings, minification Page & object caching Highly customizable WP Rocket User-friendly interface All-in-one caching Great for non-techies Configuring Your Caching Plugin
Once you have selected a caching plugin, configuration is key to maximizing its efficiency. The basic steps involved usually include:
- Activating the Plugin: Install and activate the caching plugin from your WordPress dashboard.
- Setting Up Cache Types: Choose which types of caching (like page caching or browser caching) you want to enable.
- Clearing Cache: Regularly clear your cache to prevent outdated content from being served to visitors.
- Testing Performance: Use tools like GTmetrix or Google PageSpeed Insights to test the impact of your caching setup.
By properly utilizing a caching plugin, you can significantly cut down the total number of HTTP requests generated on your WordPress site, resulting in faster load times and improved overall performance. This not only pleases your visitors but also positively influences your site’s ranking on search engine results pages.
10) Regularly Update WordPress and Plugins
Importance of Regular Updates
Keeping your WordPress installation up to date is crucial not only for enhancing security but also for optimizing performance. Regular updates help to ensure that your site runs smoothly and efficiently, which directly contributes to making fewer HTTP requests. When WordPress and its plugins are outdated, they may require additional requests to operate correctly or, worse, introduce security vulnerabilities that can compromise your website’s integrity.
Impact on HTTP Requests
Outdated plugins and themes can often lead to excessive HTTP requests due to inefficient coding or unoptimized features. By regularly updating your plugins, you can benefit from:
- Bug Fixes: Developers frequently patch bugs that can otherwise cause inefficient HTTP calls.
- Performance Improvements: New features and optimizations may reduce the number of requests needed.
- Compatibility: Ensure compatibility with the latest WordPress version, minimizing potential conflicts that lead to additional requests.
Best Practices for Updating
To effectively manage updates without disrupting your site, consider the following best practices:
- Backup Your Site: Always create a backup of your WordPress site before conducting any updates. This helps you restore the previous version if something goes wrong.
- Schedule Regular Updates: Set a specific time, perhaps weekly or bi-weekly, to check for updates. Keeping a routine minimizes the risk of missing critical patches.
- Test Updates in a Staging Environment: If possible, implement updates on a staging version of your site first. This allows you to identify any issues that may arise without impacting your live website.
Utilizing Update Management Plugins
Consider using plugins designed to manage and automate updates. Some popular options include:
Plugin Name Features URL WP Auto Updater Automates plugin updates and backups. Link Easy Updates Manager Full control over updates, including automatic updates. Link ManageWP Centralized dashboard for multiple sites, including bulk updates. Link By regularly updating WordPress and plugins, you not only protect your site but also enhance your website’s loading speed by minimizing unnecessary HTTP requests. A well-maintained WordPress site leads to a better user experience, which is essential for keeping visitors engaged and improving SEO rankings. In the long run, staying on top of updates is a foundational practice in maintaining a healthy website.
10 Ways to Reduce HTTP Requests in WordPress
What are HTTP requests, and why do they matter for WordPress?
HTTP requests are requests made by a web browser to a server to load web resources such as images, scripts, and stylesheets. In WordPress, the number of HTTP requests can significantly affect page load times. Fewer requests usually lead to faster loading pages, enhancing user experience and improving SEO rankings.
How can I combine multiple CSS files into one?
Using a plugin like Autoptimize or WP Rocket, you can easily combine multiple CSS files into a single file. This reduces the number of requests because the browser needs to fetch just one stylesheet instead of several. Make sure to test your site after combining files to ensure styles are still applied correctly.
Is it helpful to use a content delivery network (CDN)?
Yes! A CDN can deliver your static files (images, CSS, JavaScript) from servers located closer to your users, which reduces load times and the number of HTTP requests made to your origin server. Some popular options include Cloudflare and MaxCDN.
How do image optimization tools help reduce HTTP requests?
Optimizing images involves compressing and resizing them to lower resolution and file size. Tools like Smush or Imagify can help you optimize images which not only reduces the size of each request but also often allows you to use fewer and larger images instead of multiple small ones.
Can I defer loading of JavaScript files?
Absolutely! Deferring JavaScript means that scripts will only load once the essential HTML has finished loading. By doing this, you can improve page load performance and reduce initial HTTP requests. Plugins like WP Fastest Cache allow you to implement this feature effortlessly.
What is the benefit of using inline CSS and JavaScript?
By using inline CSS and JavaScript, you can reduce the number of HTTP requests required to load your site, as styles and scripts are embedded directly into the HTML. However, it’s essential to balance the amount of inline code to avoid bloating the HTML document, which could lead to longer load times.
How does browser caching contribute to fewer HTTP requests?
Browser caching allows files to be stored on a user’s device after the first visit, so they don’t have to be downloaded again on subsequent visits. Configuring caching via your .htaccess file or using plugins like W3 Total Cache can significantly reduce the number of HTTP requests and speed up page loading times for returning visitors.
Is it worth reducing plugin usage to minimize requests?
Yes, each plugin can potentially add additional HTTP requests. Evaluating the necessity of each plugin can help you reduce bloat. Try to find functionality within your theme or consider multi-functional plugins that can replace several single-purpose plugins.
How can I utilize lazy loading for images and videos?
Lazy loading is a technique that postpones the loading of images and videos until they are about to enter the viewport. This can significantly lower the number of initial HTTP requests and speed up the loading of the page. Many WordPress plugins like Lazy Load by WP Rocket make this process easy to implement.
Can I reduce the number of web fonts used in my WordPress site?
Yes, web fonts can contribute to multiple HTTP requests. By limiting the number of font families and styles you use, you can decrease the number of requests. Consider using system fonts or combined font kits where possible. For more information on web font performance, check out web.dev.
Conclusion: Streamline Your WordPress Experience
Reducing HTTP requests can significantly enhance your WordPress site’s performance, improve loading times, and ultimately provide a better user experience. By implementing the ten strategies outlined in this listicle, you’ll not only make your website faster but also optimize its overall efficiency. Remember, even the smallest adjustments can lead to substantial improvements!
For more insights on web performance optimization, you may want to check out GTmetrix, a valuable resource that offers in-depth analysis and recommendations for improving your website speed.
Start making these changes today and watch your site’s performance soar! As you continue to refine your WordPress strategy, keep experimenting with new techniques and tools, and don’t hesitate to revisit this guide whenever you need a refresher. Happy optimizing!