Wp Rocket使用教程

How to set up WP Rocket and test your WooCommerce store

Last updated on December 2, 2026 at 9:06 PM

When WordPress queries its database and assembles the same product page for every visitor, shoppers can spend longer waiting. WP Rocket can cache pages suitable for public reuse and adjust how styles, scripts, and images load. Start with default caching, then test mobile navigation, product options, and checkout as you change each setting.

Record the site’s current behavior

Choose a homepage, a product or article, and a cart or contact form. Test them on mobile or in a private window. Note when the main image appears, whether the menu opens, and whether the form submits. For measurements, run PageSpeed Insights three times on the same public URL in the same device mode and take the median. Test carts, accounts, and orders by actually using them.

Back up the site. If your host, CDN, or existing plugins handle page caching, lazy loading, or script minification, record which tool owns each job. Managed hosts sometimes control page caching and WP Rocket adjusts available options to the environment. Assign each optimization to one place where possible and test changes individually to avoid processing the same script twice.

Install WP Rocket and verify default caching

  1. Choose the appropriate number of site licenses at the official WP Rocket website. Existing customers can sign in to their purchase account and download the WP Rocket ZIP.
  2. In WordPress, open Plugins → Add New Plugin → Upload Plugin. Select the ZIP without unpacking it, then choose Install Now → Activate Plugin. Open the plugin dashboard under Settings → WP Rocket.
  3. On hosts that support WP Rocket page caching, activation starts caching eligible pages for logged-out visitors. Open a public product page while signed out and reload it. Use View page source and look for “Performance optimized by WP Rocket.” A comment that includes cached@ and a timestamp indicates that WP Rocket generated that cache. If your host supplies its own cache or a CDN strips comments, also check the host’s cache status.
Wordpress Plugin Upload Screen For Selecting A Zip Installation Package
Select The Zip Downloaded From Your Customer Account In The Upload Plugin Dialog.
Cache, Page Optimization And Tools In The Wp Rocket 3.24 Dashboard
In The New Version, “Page Cache” Has Been Moved To “Cache” On The Left Side, While “Images,” “Fonts,” And “Scripts” Have Been Moved To “Page Optimization.”

Which file optimization settings should you enable first?

Under Page Optimization → JavaScript & CSS, change one option at a time, save, and retest the same pages in a new private window. Jobs such as removing unused CSS run in the background. Compare results after the job finishes and the page cache regenerates.

  • Remove Unused CSS attempts to retain only the styles a page needs. After enabling it, expand a collapsed menu, choose a product color, and open a popup. Elements hidden on initial load are easy to overlook.
  • Load JavaScript deferred lets the browser parse the document first. Check that image sliders, product variations, and forms initialize correctly after saving.
  • Delay JavaScript execution can postpone scripts until a visitor interacts. The first click on the menu or a size selector should work. If a second click is needed, disable this setting alone and repeat the test. Once you’ve identified the cause, try excluding only the affected plugin scripts using the compatibility exclusions.
Options To Load Javascript Later And Delay Its Execution In Wp Rocket 3.24
In Page Optimization, Test Deferred Javascript Loading And Delayed Execution One At A Time.

Images, videos, fonts, and preloading

Under Page Optimization → Image & Media, enable LazyLoad for below-the-fold images and video embeds to load them as visitors approach. For YouTube embeds, try a preview image in place of loading the full player initially. Add missing image dimensions supplies missing width and height and can reduce layout shifts. After saving, first inspect the main photo on a phone, then scroll down to check detail images and play a video.

Option To Add Missing Image Dimensions In Wp Rocket
Select Add Missing Image Dimensions To Supply Width And Height For Images That Lack These Attributes.

If the top image appears later, check whether the theme, an image plugin, and WP Rocket are applying lazy loading more than once. For images several megabytes in size, reduce the actual file using our Imagify image optimization guide. For slow fonts, try Page Optimization → Image & Media → Fonts → Preload fonts. The plugin detects fonts needed for above-the-fold text after page visits and cache regeneration.

Cache → Preload prepares a page’s cache before the first visitor requests it. Preload links starts preparing a likely next-page request. If your catalog is large or hosting resources limited, check resource usage and product page behavior before adjusting preloading. An additional CDN purchase isn’t required for basic page optimization.

How to test WooCommerce

WP Rocket excludes standard WooCommerce cart, checkout, and My Account pages by default. A custom member-pricing page, purchase flow, or third-party cache can have separate settings. Exclude personalized pages that show addresses or prices under Cache → Cache Rules using their actual paths, and check whether the CDN also caches those paths.

  1. Try two independent sessions. Open the store in one visitor window and a separate browser. Add different products or quantities and check each session sees only its own cart.
  2. Complete a checkout. Change a variant, apply a coupon, update the shipping address, and place an order with the payment gateway in test mode. Compare the total with the order recorded in the dashboard.
  3. Test the first click. In a fresh window, immediately open the mobile menu, accept or decline cookies, or open the size guide. If a failure appears only while signed out, record the URL and most recently enabled setting.

How to recover if a page breaks

Undo the most recent change and save. Purge the affected page and external CDN cache if needed, then retest in a fresh private window. If disabling delayed JS restores a button, start with that setting’s script exclusions. If several changes were made, export the current configuration under Tools → Tools first. When choosing Safe Mode from the plugin deactivation dialog, keep the option to export settings. Safe Mode resets relevant optimizations so you can re-enable verified ones individually.

Repeat your original speed tests using the same URLs and device settings. Record the results after verifying the layout is stable, the first screen is usable, and the purchase flow works. Repeat these checks when changing themes, updating a payment plugin, or adding a substantial script.

Diagnose a size selector that ignores the first tap

  1. Log out and open the product page in a fresh private window. Make the size selector your first tap. In another private window, open the same product with ?nowprocket at the end of its URL. If the URL already has a query string, append &nowprocket instead. Repeat the same tap on the same device.
  2. If the selector works only on the URL with the parameter, open Page Optimization → JavaScript & CSS and turn off only Delay JavaScript execution. Save, regenerate the page cache and test the regular URL again. If the selector now works, try excluding just the script it needs before turning Delay back on.
  3. If neither URL works, investigate on a staging site before changing other settings. The parameter bypasses many of WP Rocket’s front-end optimizations, but your host or CDN may still serve a cached response. Confirm that a visitor on the regular URL can select their size on the first tap and add the correct variation to the cart.

Leave a Comment

Scroll to Top