Prompt
How do I improve delivery for a global SaaS app with lots of static assets?
Latest observation
To improve delivery for a global SaaS app with lots of static assets, focus on reducing distance, reducing bytes, and improving cacheability.
1) Put static assets on a CDN
This is usually the biggest win.
- Serve images, JS, CSS, fonts, and downloads from a global CDN
- Use edge caching so users fetch assets from the nearest PoP
- Set long cache lifetimes for versioned assets
Best practice:
- Fingerprint assets in filenames:
app.8f3a1c.js,styles.91bd2.css - Then cache them aggressively:
Cache-Control: public, max-age=31536000, immutable
2) Split static and dynamic delivery
Keep your app backend and static content separate:
- App/API: origin servers or regional compute
- Static assets: object storage + CDN
- Avoid routing asset requests through your app servers
This reduces load and improves latency.
3) Optimize asset size
Make assets smaller before worrying about delivery.
- Compress text assets with Brotli or gzip
- Convert images to modern formats:
- AVIF or WebP
- Resize images to actual display dimensions
- Use responsive images (
srcset,sizes) - Minify JS/CSS
- Remove unused CSS/JS
- Lazy-load offscreen assets
4) Cache smartly
Use multiple layers of caching:
- Browser cache for repeat visits
- CDN cache for global edge delivery
- Origin cache to protect your backend if CDN misses occur
For assets that rarely change, use:
- long TTLs
- immutable URLs
- cache busting via content hashes
For assets that do change often:
- shorter TTLs
- purge/invalidate on deploy
5) Use HTTP/2 or HTTP/3
These improve parallel delivery and reduce latency.
- HTTP/2: multiplexing, header compression
- HTTP/3: better performance on lossy networks, uses QUIC
Most major CDNs support both.
6) Reduce request count
Too many small files can hurt performance.
- Bundle carefully
- Inline only critical assets when it makes sense
- Use sprite sheets only if appropriate; modern CSS/HTTP often makes them less necessary
- Preload key assets:
- critical CSS
- main fonts
- hero images
7) Add image and font optimizations
These often dominate page weight.
Images
- Use lazy loading
- Serve multiple sizes
- Prefer modern codecs
- Store originals in object storage, generate derivatives at the edge or build time
Fonts
- Subset fonts
- Use
font-display: swap - Preload only essential font files
8) Cache at the edge by geography
For a truly global SaaS app:
- Use CDNs with many PoPs near your users
- Consider regional origin replication if you have large files or frequent misses
- Keep origin close to the CDN and use origin shielding to reduce hits
9) Measure and tune
Track:
- cache hit ratio
- TTFB
- LCP
- total transferred bytes
- regional latency
- origin offload
Tools:
- WebPageTest
- Lighthouse
- Real User Monitoring (RUM)
- CDN analytics
10) Recommended architecture
A good default setup looks like:
- App/API behind load balancer in multiple regions
- Static assets in object storage
- CDN in front of all static assets
- Versioned asset filenames
- Aggressive browser + CDN caching
- Image processing pipeline
- RUM + CDN logs for continuous optimization
Quick wins checklist
If you want the fastest path to improvement, do these first:
- Put assets behind a CDN
- Fingerprint filenames and cache for 1 year
- Compress with Brotli/gzip
- Convert images to WebP/AVIF
- Remove unused JS/CSS
- Add lazy loading
- Use HTTP/2 or HTTP/3
- Monitor cache hit ratio and page performance
If you want, I can also give you:
- a reference architecture
- a CloudFront/Fastly/Cloudflare setup
- or a cache header strategy for static assets.