Webflow sync, pageviews & more.
NEW

How can I fix the "Add expires headers" issue in GTMetrix for my Webflow site?

TL;DR
  • Host critical assets like JavaScript libraries and custom fonts locally in Webflow to benefit from its default caching.
  • Limit or remove unnecessary third-party scripts and external resources, which often trigger cache warnings that can't be fixed on your end.

The "Add Expires headers" issue in GTMetrix warns that some static assets (like images, JavaScript, or CSS files) don’t specify how long browsers should cache them. Webflow partially handles this, but third-party or custom assets may trigger the warning.

1. Understand What Can Be Controlled

  • Webflow-hosted assets (images, CSS, JS served by Webflow) are already optimized—Webflow automatically includes cache-control headers.
  • Third-party assets (e.g., fonts from Google Fonts, scripts from third-party CDNs, embedded videos) are often the root cause.
  • GTMetrix cannot override how external servers handle caching, so you’ll only be able to resolve this for assets under your control.

2. Minimize Use of External Resources

  • Inspect your GTMetrix report and identify which URLs are flagged.
  • If they are from domains like fonts.googleapis.com, youtube.com, or cdn.some-library.com, those are out of your control.
  • Use local hosting for critical assets (like JavaScript libraries or custom fonts) by uploading them to your Webflow project.

3. Host Custom Assets in Webflow

  • Convert third-party hosted files to static files.
  • Go to Webflow Designer > Assets panel, upload your files, and use those URLs in Embed or Custom Code sections.
  • This benefits from Webflow’s default cache headers (typically 1 year for static assets).

4. Remove Non-Essential External Scripts

  • Evaluate scripts embedded via the Project Settings > Custom Code tab or added using Embed elements.
  • Remove or defer unnecessary third-party scripts (analytics trackers, widgets, etc.) as each may introduce unoptimized headers.

5. Use a Reverse Proxy (Advanced)

  • If you truly need control over all headers, including third-party, this requires serving Webflow through a reverse proxy (like Cloudflare Workers or CloudFront).
  • This is technically complex and not officially supported by Webflow—not recommended unless you have dev ops experience.

Summary

You can’t fully fix the "Add Expires headers" issue in Webflow due to third-party resources, but you can reduce its impact by hosting custom assets locally, limiting external scripts, and allowing Webflow to apply its caching to your files.

Rate this answer

Other Webflow Questions