How does Lightning adaptive page cache pregeneration works?

Lightning uses adaptive page cache pregeneration to ensure optimal cache coverage based on visitor activity. Rather than pre-generating the entire site at once, it prioritizes content based on user behavior.

The Pregeneration Logic

  1. Initial Wave: When the cache is cleared, Lightning immediately starts pre-generating pages linked directly from the homepage (indicated by a green progress bar).
  2. Second Wave: Once the first wave is complete, the system generates pages linked from the previous set. This covers all content up to "two clicks" away from the homepage.
  3. Visitor-Driven: When a user visits a specific page, Lightning begins pre-generating links found on that page (two clicks deep). If the server is fast enough, the next page the user clicks may already be cached by the time they finish reading the current one.

Performance & Resources

Handling Variations: please note that page cache variations depends on your shop’s configuration and Lightning settings. Preneration is done for specific variation of the current visitor (not all at once). Variations may include:

Estimating Generation Time Lightning does not offer a "Generate All" button, but consistent traffic will eventually cache most of your site. To estimate the total time required for full coverage:

Formula: (Total Pages × Generation Speed) × Variations

Example:

24,000 pages × 0.3 sec = 7,200 sec (2 hours)
2 hours × 6 variations = 12 hours

If the final calculation is significantly greater than 24 hours, all pages simply cannot be pregenerated. In this case, Lightning will naturally focus on covering the most active parts of your shop.


If you have Lightning CRON job configured you may see how the pregeneration works clicking at Tools -> Lightning CRON Job Activity:

Created 2026-02-02