Skip to main content

Performance

Expected performance impact

ConsentForge is designed to have minimal performance impact:

MetricImpact
Script size< 10 KB gzipped
Script load (CDN)~20–50ms from EU (cached)
Time to first byte (TTFB)No impact (async/defer)
Largest Contentful Paint (LCP)No impact if defer is used
Cumulative Layout Shift (CLS)Minor (~0.01) from banner insertion

Reducing CLS from the banner

If you're optimising Core Web Vitals, reserve space for the bottom bar before the script loads:

body {
padding-bottom: 80px; /* approximate banner height */
}

Or use the data-position="inline" embed option to render the banner in a fixed container.

Symptom: Script slowing down page load

How to check: PageSpeed Insights / Lighthouse → "Eliminate render-blocking resources". Is consentforge.min.js listed?

Cause: Script tag missing defer attribute.

Fix: Ensure your embed script uses defer:

<script src="https://cdn.consentforge.com/consentforge.min.js" data-token="..." defer></script>

CDN caching

ConsentForge's runtime is served from cdn.consentforge.com with a 7-day cache (Cache-Control: public, max-age=604800). On repeat visits, the script loads from the browser cache with zero network latency.

Symptom: Runtime loading from wrong region

How to check: DevTools → Network → consentforge.min.js → check response header x-served-by.

Fix: The CDN auto-routes to the nearest PoP. If you see unusually high latency, contact support — it may indicate a CDN routing issue.

Self-hosting the runtime (Enterprise)

Enterprise customers can self-host the ConsentForge runtime bundle on their own CDN for maximum control over loading performance. Contact support to enable this option.