To improve website performance in Webflow based on GTmetrix audits, you need to align with efficient cache policies—especially for static assets like images, CSS, JS, and fonts.
1. Understand Webflow's Native Caching
- Webflow automatically sets caching headers on assets like images, CSS, JS hosted on its CDN (Amazon CloudFront).
- Static assets typically receive a cache-control: max-age=31536000 (1 year) to maximize long-term caching.
- These headers are not user-configurable within Webflow.
- GTmetrix may still flag this if assets are served from inline styles or if dynamic resources don't have caching.
2. Reduce Use of Inline Assets
- GTmetrix penalizes inline styles and scripts that cannot be cached.
- Where possible, move inline styles to global site styles in Webflow’s Style panel or custom code head section.
- Avoid excessive use of custom code inside individual pages or embeds unless needed.
3. Host Custom Assets Externally With Cache Control
- For assets not hosted by Webflow (e.g., videos, fonts, or third-party scripts), use a CDN like Cloudflare or AWS S3 where you can control cache headers.
- Set a strong cache policy (e.g.,
Cache-Control: public, max-age=31536000
) when serving from those external sources.
4. Optimize Images Within Webflow
- Use Webflow’s built-in image optimization by uploading high-quality images (Webflow converts them to optimized formats and sets cache-friendly headers).
- Enable Responsive Image support when uploading images so Webflow generates multiple resolutions.
- Avoid using GIF files or embeds that bypass CDN caching, unless necessary.
5. Minimize Usage of External Fonts and Scripts
- Fonts from Google Fonts or external CDNs may lack ideal cache headers.
- Consider hosting fonts locally using custom code and a CDN that allows header configuration.
- Reduce external scripts from marketing tools or widgets unless critical.
6. Utilize Webflow’s Site-Wide Minify and Optimization Settings
- Go to Project Settings > Hosting and turn on:
- Minify HTML
- Minify CSS
- Minify JS
- Enable gzip compression (this is handled automatically by Webflow)
7. Test and Retest
- After implementing changes, run your site through GTmetrix and WebPageTest.
- Focus on reducing the number of uncacheable resources and ensure your Time To First Byte (TTFB) remains low.
Summary
Webflow already sets strong cache policies for most assets, but to better align with GTmetrix audits, you should limit inline code, host custom resources on CDNs with cache control, and optimize your use of external scripts. While direct control of headers in Webflow is limited, strategic use of external tools and best practices can significantly improve caching efficiency.