I have an application that generates static pages. say roughly around 10 html pages/min. These pages are going to be served to users. On server side, I am using Django as development framework with Gunicorn to run my App server and I am using Nginx as 'Reverse Proxy'.
With this stack, I have few doubts regarding my design for Storing and Serving content. Also I am not sure, If my approach will cause any performance penalty which I am not able to guess now. So here are my thoughts on this:
Storage
I am thinking of a flat file based system to store content. Which will be stored according to timestamp so that I can clear/delete them up in future In case content is expired or it's not required. So path for a typical file will look like /var/www/project/content/timestamp/file/path
.
I also checked Django Flatpages (app available in Django) which allows easy maintains of flatpages using admin panel and API. But this looks more promising for,
- Fixed number of pages and
(for me, it's huge and varying)
- If you have any Editing requirement for the pages.
(I don't need this)
Serving
For serving the content I am planing of exposing the '/var/www/content/' folder by Nginx so that it can be directly served by Nginx without any delay from app server. In case, I see any performance hit. I can use some static file caching Engine like Varnish.
Any suggestion or thought will be helpful. Thanks..