{% endwagtailpagecache %}
```
````
---
layout: cover
background: /website-search.png
---
# Duplication
---
layout: center
---
```html {3}
{% for page in listing_pages %}
{% include "common/listing-item.html" %}
{% endfor %}
```
---
layout: image
image: /website-search.png
---
---
# Cache invalidation
```python
>>> BlogPostPage.objects.first().cache_key
```
```python
@property
def cache_key(self) -> str:
"""
A generic cache key to identify a page in its current state.
Should the page change, so will the key.
Customizations to the cache key should be made in :attr:`get_cache_key_components`.
"""
...
```
---
layout: center
---
# What about Django?
```jinja
{% load cache %}
{% cache 500 sidebar request.user.username %}
.. sidebar for logged in user ..
{% endcache %}
```
- Current page
- Current site
- Preview
- Cache invalidation
---
layout: section
---
## 2:
# Frontend Caching