1

I am the webmaster of a dynamic website, and because of plenty of complicated queries that I have to use on the front page and some other pages, the server suffers sometimes from overload, when the number of visitors of our website is elevated.
So, I got the Idea to generate periodically (every 2 minutes) an html static snapshot of these pages. This would charge the server just once per 2 minutes by just one user.

My question is: Is this a good Idea? because I plan to generalize it over many other pages, and I don't want to be surprised and have to go back again.

If it isn't, is there any good ideas to avoid this charge?

Thank you in advance

PS: I would maybe publish the method I use to do this, to see if there is a better way.

3
  • You might want to research caching ;-) Commented Feb 13, 2014 at 12:35
  • I was gonna say 'caching' as well but. Does he want to make his own custom caching though? o.O Commented Feb 13, 2014 at 12:36
  • It seems that this is what I was trying to do Craftein, but it's just because I didn't know about caching ;) thank you all for your help, I will not try to reinvent the wheel Commented Feb 13, 2014 at 15:02

4 Answers 4

1

I don't think it's a bad idea, but you should use an existing caching solution rather than implementing your own. Why not to use memcached? I think that's what you are looking for, just use it for those parts of your code that are taking long time.

Sign up to request clarification or add additional context in comments.

1 Comment

I didn't know I can do it... thank you very much, I will search about memcached
0

Caching is a good idea to protect your server from overloading. Many CMS (Content Management System) use this technique.

Comments

0

Sure, it's called caching :)

However, most sites are caching just parts of their content. You can't cache a whole page if you are using user specific content, for example the name of a logged-in user. But you can cache the heavy parts of your site and combine it with a dynamic page.

1 Comment

thank you mplungjan.. I will start searching about caching :)
0

Your idea is really good and many big websites are using this concept. You can also using Caching techniques, if you want avoid database hit then you can use caching technique it will be better. you can use Memcached http://memcached.org/.

1 Comment

Thank you very much for your help.. I didn't know about caching.. I will start from the link you gave me :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.