Code layout

Architecture

The module class only orchestrates hooks; all the logic lives in dedicated classes under classes/, loaded by a custom autoloader (FaAutoload). Front controllers: warmup (warm-up), refresh (rebuilt pages), vitals (visitor measurements), dynblock (dynamic areas and islands).

ClassRole
FaCacheEngineOrchestrates isCacheable(), serveFromCache(), storePage() and storeListing(). Heart of the read/write cycle.
FaPageKeyBuilds the storage key: hash of the normalised URL + signature of the visit variant (shop, language, currency, device, country, customer groups); detects device from the user agent.
FaCacheDAODatabase access: cached pages (fa_pc_page), visit variants (fa_pc_variant), links between pages (fa_pc_link), response times (fa_pc_ttfb), warm-up log (fa_pc_warmup_log), scheduled prices, targeted invalidation.
FaCacheBackendFactorySelects the configured backend with automatic fallback (Memcached → zip → filesystem) based on what is actually available.
FaCacheBackendFile / …Zip / …MemcachedConcrete implementations of FaCacheBackend: read, write, purge and flush the storage.
FaImageOptimizerConverts images to WebP/AVIF (GD or Imagick) and rewrites <img> tags into <picture>.
FaHtmlMinifierStrips extra whitespace and comments from HTML before caching, preserving <pre>/<script>/<style>.
FaLazyLoaderRewrites image src to data-src for lazy loading, except explicit exceptions (LCP image, logo…).
FaDoctor / FaDoctorCheckA series of environment checks shown in the Diagnostic tab.
FaWarmupScheduled warm-up: the /module/freshappprestacache/warmup?token=… address, called every minute, only runs every 15 minutes, or on every call in boost mode. A run first rebuilds the priority pages (FaRefresh), then requests the home page, categories, products, CMS pages and brands in every language, up to 25 s, resuming where the previous run stopped. Lock file var/warmup.lock shared with the back-office button; log in fa_pc_warmup_log, purged after 30 days.
FaRefreshRebuilds invalidated pages in the background (refresh column and controller), most visited first and for each device; keeps popular pages warm during warm-up.
FaLcpBoosterMain content image set to fetchpriority="high" and exempted from lazy loading.
FaVitalsVisitor Core Web Vitals (views/js/vitals.js, vitals controller, fa_pc_vitals table) and 75th percentile for the dashboard.
FaAuditPersonal block detection: renders compared for two temporary analysis customers (signed internal requests, X-FaPC-Audit).
FaCdnCloudflare or Bunny purge of invalidated pages, batched at the end of the request.
FaIslandPersonal islands: while a page is built, wraps visitor-specific blocks (signed comments) through the Hook::coreCallHook / coreRenderWidget override; renders their real content for a logged-in customer.
FaWitnessInactive witness customers, one per group combination: the shared version of a page is never built from a real customer.
Loading...
Back to top