1. Moved from a shared hosting server to my own custom server. This alone my latencies went from 20s (sleep wakeup latencies) or 5s (woke response latencies) down to about .5s-1s.
2. Use Streaming HTTP response to immediately send HTTP header & initial HTML data before database is even accessed
3. Reduce the number of database lookups with select_related()/prefetch_related(). Each cached page fragment should only have one SQL query at most.
4. Don't even bother with Django ORM and use Postgres prepared SQL statements directly.
5. Use database materialized view.
6. GZIP cached data & serve GZIPed response (has side benefit of effectively making cache 10x bigger)
7. Move from NGINX to H2O web server for HTTP/2 (awesome little server that does http/2 cache-aware server push. See https://h2o.examp1e.net)
8. Build a simple Javascript single-page app framework
9. Use Postgres JSON data types for API calls
10. Run a separate python logging process outside of Django response.
11. Further optimizations to speed up HTML (cut down repaints), CSS (GPU animations), JS, DNS, and TLS/SSL.
It's amazing the amount of crap & inefficiencies that are in web services. A CPU can do trillions of calculations a second.. why should a web site take trillions of calculations to send a single page?