How to improve the TTFB for Django ?

Hello, I have a Django web site on Ubuntu droplet and its response time varies from 300 to 200 ms. This is not bad but not enough for good ranking in search engines. I tried 2 times to switch to droplets with better performences but had no change in TTFB at all. Can someone recommend some ways in server or nginx settings which will help for Django web site ? Thanks in advance !!!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

First, 200-300 seconds is very fast. I don’t really see many problems with that, but if you really need to increase the speed, try using installing the django-debug extension/module. It will give you some insights on what’s happening on each request, the SQL queries performed, and such. You can look at that to figure out problems that are making it slower than you expected it to and make it faster.

Also, try caching with something like Redis or Memcached, Django’s default cache system is quite good in this regard.