Workshop
The workshop consists of a set of questions and answers designed to solidify your understanding of the material covered in this hour. Try answering the questions before looking at the answers.
Quiz
1. | What types of caching backends could you use if you wanted the cache to be stored in a persistent state? |
2. | What type of cache should you use if you want web pages from only two specific views cached? |
3. | How can you cache an instance of a Django model? |
4. | What function would you use inside a view function to add the Content-Language header to the Vary header? |
Quiz Answers
1. | The db and file backends. |
2. | The view-level cache using the cache_page() decorator function. |
3. | Use the django.core.cache.cache.set() function. |
4. | The django.utils.cache.patch_vary_headers() function. |