<blockquote>
  <p>Is this helpful, or am I just being OCD?</p>
</blockquote>

<p>Completely OCD. :)</p>

<p>The database backup class already excludes unnecessary tables like asset indexing data, sessions, template caches, etc. during a backup.</p>

<p><a href="https://github.com/craftcms/cms/tree/master-v2/src/etc/db/DbBackup.php#L46" rel="nofollow noreferrer">https://github.com/craftcms/cms/tree/master-v2/src/etc/db/DbBackup.php#L46</a></p>

CC BY-SA 3.0
2016-01-28T19:42:01.640Z
Boom... and I see all three `templatecache` tables listed there. Didn't even think about assets or sessions!
Lindsey D
CC BY-SA 3.0
2016-01-28T19:38:56.483Z
2018-02-21T23:44:52.067Z
2018-02-21T23:44:52.067Z
Brad Bell
<p>Every time I create a database backup, I find myself instinctively clearing the cache first. My gut tells me that any cached data would be unnecessarily included in the export.</p>

<p><strong>Is this helpful, or am I just being OCD?</strong></p>

<p><a href="https://i.sstatic.net/YajOj.png" rel="noreferrer"><img src="https://i.sstatic.net/YajOj.png" alt="enter image description here"></a></p>

<database><cache>
Good practice to "Clear Caches" before you "Backup Database"?
# Good practice to "Clear Caches" before you "Backup Database"?

(Asked by: username_0 on 2016-01-28)

Every time I create a database backup, I find myself instinctively clearing the cache first. My gut tells me that any cached data would be unnecessarily included in the export.

**Is this helpful, or am I just being OCD?**

[![enter image description here](https://i.sstatic.net/YajOj.png)](https://i.sstatic.net/YajOj.png)

**Tags:** database, cache


---

## 1 answers

### Answer by username_1 on 2016-01-28. Score: 6 | Accepted answer

> Is this helpful, or am I just being OCD?

Completely OCD. :)

The database backup class already excludes unnecessary tables like asset indexing data, sessions, template caches, etc. during a backup.

<https://github.com/craftcms/cms/tree/master-v2/src/etc/db/DbBackup.php#L46>

> **Comments:**
> **username_0**: Boom... and I see all three `templatecache` tables listed there. Didn't even think about assets or sessions!  

---

