precaricamento-wprocket

Preloading in WP Rocket

Questo contenuto è disponibile in Italiano

The Preloading section of WP Rocket, as the name suggests, is about pre-generation of different entities.
It is divided into 3 parts:

  • Preloading cache,
  • Preloading link,
  • Preloading DNS requests.

For complete documentation, please refer to the official page.
As always, we recommend that you inquire about the integration between WP Rocketeyour server! For example, in the case of Kinsta, even if WP Rocket is fully compatible, some features such as cache preloading or file minification (should the Kinsta server-side one also be enabled) are not recommended.

Cache preloading

Pagecache preloading (cache preload) involves the page cache being generated independently by WP Rocket, regardless of user interactions.
As seen in the previous article, this is arecommended and default setting of WP Rocket.
If preloading is turned off, each page will require at least one visit to be cached.
Therefore, the first user will always view it slower. preloading wp rocket If enabled without additional options, WP Rocket will generate the cache starting from the home page and continuing independently based on all detected links.
By activating the “Enable cache preloading based on sitemap” option, the sitemap is automatically detected and preloaded.
Sometimes it is also possible to confirm the detected sitemap.
This is the case with Yoast SEO: wp rocket active preloading Cache preloading occurs globally:

  • When the cache expires,
  • With each save of WP Rocket settings,
  • Upon clicking the appropriate“Preload cache” command,
  • Uponactivation of the plugin,
  • On clearing the cache.
  • In additional cases determined by specific servers or plugins such as Varnish HTTP Purge.

Individually, it occurs when publishing/updating content.
If mobile version cache separation is enabled, the mobile version cache is also preloaded along with the desktop part: user cache preloading If WebP compatibility is enabled, WP Rocket will preload that cache instead of the non-WebP cache for the files involved.
To verify that the cache preloading is working properly, access via FTP to the /wp-content/cache/wp-rocket/name/ folder.
Inside will be all the cache files created.
By clicking on “Preload cache,” the contents of the folder will be updated. precaricamento funzionamento Through plugins such as WP-Cron Status Checker or WP Crontrol, it is also possible to check the scheduling of preload actions.
Not to be underestimated, the chesty site health panel viewable in Settings –> Site Health.
From here we can verify that planned events have not failed.
If an error 28 related to cURLs appears, this normally indicates a slow response from the server.
In such a case, the suggestion is to contact the service provider.

More information about cache preloading

Cache preloading never consumes more than 90% of the available PHP memory.
CPU utilization problems should never occur.
Sitemap-based preloading requires that on serverSimpleXML PHP extension is enabled.
The default interval for crawling between URLs is 500ms.
It is possible to change it using an extension.
It is possible to schedule cache preloading by creating an appropriate cron.

Preloading of links

Only on Chrome and Chromium browsers! Link preloading improves the perceived interaction time of the user browsing the site.
If the user scrolls over a link for more than 100 ms, the HTML content of the linked page will be preloaded in the background.
The option does not result in improvements in PageSpeed scores, Pingdom, GT Metrix, etc.
They are automatically excluded:

  • Miscellaneous administration URLs;
  • URLs excluded from WP Rocket cache;
  • Images;
  • Links with search strings and anchors;
  • External URLs.

It is also possible to manually exclude specific URLs, by function. Warning.
Files (including .docx) are not excluded from link preloading.
This can cause errors mainly due to the automatically queued “/” slash.

To avoid this, rules can be created using the WP Rocket | Regex Exclusions extension.

Preloading DNS Requests

PreloadingDNS requests(DNS prefetch) comes in particularly handy if there is third-party content on the page.
It causes DNS resolution to occur before the user’s interaction with the external content.
Technically, it is addedrel="dns-prefetch" to the header.
For example, CDN, Google fonts, Pixel, Analytics, Tag Manager are handled in this case:

<link rel="dns-prefetch" href="https://cdn.domain.com">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link rel="dns-prefetch" href="https://connect.facebook.net">
<link rel="dns-prefetch" href="https://www.google-analytics.com">
<link rel="dns-prefetch" href="https://www.googletagservices.com">

The improvement is not easily evaluated, but it is a recommended practice. GT Metrix may suggest reducing DNSlookups (Reduce DNS Lookups).
DNS preloading does not result in the elimination of the suggestion: it does not eliminate requests, but anticipates them.
The only permanent solution remains the removal of third-party content.

Preload fonts

Preloading fonts within the element<head>, these will be downloaded before being identified within the CSS.
If the fonts are located on the domain or CDN, it is recommended to enable the option.
You cannot take advantage of the feature when they are located externally. If the “Remove Unused CSS” option is enabled within “File Optimization,” pre-loaded fonts will also be removed.

Which fonts to preload?

Google PageSpeed provides a “Preload Key Requests” entry.
It is useful to start the test by bypassing WP Rocket with parameter /?nowprocket.
Also, the URL must match the one provided by PageSpeed.
Only fonts that slow down page loading or perceived performance should be preloaded.
Preloading can be counterproductive if it involves too many fonts. Do not preload multiple formats!
Normally .woff2 is sufficient.

Notice of PageSpeed

Warnings: Lighthouse was unable to automatically check the `font-display` value for the origin

It is usually caused by preloading unused fonts.
In such cases Chrome also shows a similar warning.

Preloading of external fonts

It is not possible to implement this with WP Rocket.
However, an appropriate HTML line can be added in the <head> section.

<link rel="preload" href="https://ESEMPIO.COM/FONT.woff2" as="font" type="font/woff2" crossorigin>

The correct URL must be entered.
The type attribute should identify the correct format.
Once the code is entered, clear the WP Rocket cache.

Questo contenuto è disponibile in Italiano

Related articles

Choose Iubenda cookie banner to improve Core Web Vitals (INP)

Questo contenuto è disponibile in ItalianoThose involved in optimization in terms of Core Web Vitals, the decisive elements of a Web site in terms of the user experience on the...

Basics of WP Rocket

Questo contenuto è disponibile in ItalianoIt goes without saying-but not for everyone, it seems! – that a site’s speed is a key requirement foracquiring and retaining visitors(read also “buyers”). WP...