Reputation: 1195
Say, for example, I've got a blog post with some user comments.
What I want to do is serve a static page. If the user posts a comment, it will generate a new file (with the new content added) and serve that instead.
It's a very, very simple model. Almost too simple, so I'm wondering if there are downsides to it.
Upvotes: 1
Views: 112
Reputation: 61771
It's a very, very simple model. Almost too simple, so I'm wondering if there are downsides to it.
It is almost perfect(maybe for simple websites/small blog perfect). But couple of downside to this approach:
Upvotes: 0
Reputation: 3275
Watch out for race conditions when 2 users post a comment at the same time ... maybe one comment would disappear from the page? (At least until that cached copy expires, anyway.)
Upvotes: 0
Reputation: 3621
It prevents you from having dynamic or randomized page parts. At least with a PHP only approach. Of course you can do random/dynamic items through JS or iframes. It also means that it becomes a bit harder to deal with updates from a CMS.
Even these down sides can be skirted with relative ease. Just treat the cache like you would memcached. Or better yet, use memcached. :)
Upvotes: 0
Reputation: 29536
Downside may be (there arn't many)
To avoid it:
Upvotes: 1