UI Drafter

HTTP Cache
Hitting 304s
Across Servers

Eric Fortis

Instead of refetching uncacheable assets, users can get a lightweight 304 Not Modified response regardless of which server they hit.

For that, the assets must send the same Last-Modified time from all servers. The same applies when using the ETag header on Nginx as it generates them using that time.

For preserving modification times, deploy copying over with rsync --times.

By the way, send a Cache-Control: no-cache response header too. It prevents Chrome® from sometimes showing a 304 with a stale page. For example, when restoring a session, or when offline without a registered service worker.

Sponsored by: