Book Image

Django 1.0 Template Development

Book Image

Django 1.0 Template Development

Overview of this book

Table of Contents (17 chapters)
Django 1.0 Template Development
Credits
About the Author
About the Reviewers
Preface
Index

An overview


Generating web pages for every request can be difficult for the server. But if we can hold on to data between requests and serve it again for the next request, we can reduce the overhead of serving each page.

We use a cache to store the result of a query so that future requests won't have to look it up again. Deciding how long to hold onto the data before looking it up again depends on your situation; but the longer you can go without having to look it up, the more performance you should be able to squeeze out of your server.

Do you need caching?

How do you know if you need to implement caching on your site? Usually, there are a few warning signs that indicate the time one should think about using caching such as:

  • Processor or memory usage has climbed to a level that you are not comfortable with.

  • Your web or database server cannot keep up with the incoming requests.

  • It takes too long for the server to render a page request (the underlying page, not including images or external references...