Complete the code to start caching a template fragment with the key 'sidebar'.
{% [1] 'sidebar' %}The cache tag is used to start caching a template fragment with a given key.
Complete the code to end the cache block in a Django template.
{% [1]cache %}The cache block is closed with endcache tag, written as {% endcache %}.
Fix the error in the cache tag to cache a fragment for 600 seconds with key 'menu'.
{% cache [1] 'menu' %}The cache tag expects the timeout as an integer without quotes, so 600 is correct.
Fill both blanks to cache a fragment for 300 seconds with a variable key 'user.id'.
{% cache [1] [2] %}The first blank is the timeout in seconds (300). The second blank is the variable key without quotes (user.id).
Fill all three blanks to cache a fragment for 120 seconds with key 'product.id' and load the 'cache' template tag library.
{% [1] cache %}
{% cache [2] [3] %}
Content here
{% endcache %}First, load the cache tag library with load cache. Then use cache 120 product.id to cache for 120 seconds with the variable key.