TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Serving rendered html and static content vs. building APIs

1 pointsby zman0225almost 11 years ago
Just a quick newbie question. When I was learning flask/django I was taught to use certain python packages to render the html first on the server and then serve it. As I learned more and more technologies on the front end, I realized that letting frameworks render and serve web pages is kind of inefficient (that's why we have nginx and apache, right?) So is it wiser to just build APIs on the framework end and have the static content served separately or have everything come from the framework?

1 comment

soundoflightalmost 11 years ago
Like all questions, it really depends.<p>I would build out your project entirely first then look for possible optimizations like this. You will need to see how often this content changes, how often it is requested and the cost of regenerating it. In addition to this, you will want to look at the added engineering costs of this.<p>If it&#x27;s something that rarely changes, I usually just have a background job generate it and serve it as static content, but only if it is accessed a lot.