Can the tmp folder be deleted without harm?

My TMP folder takes a lot of space.
What is the function of the Piwik tmp folder (…/piwik/tmp/) and what is the fuction of the cache folder (…/piwik/tmp/cache).
Do we need the files in this folder or is it just a dump ?
Under which circumstances these files can be deleted?
What information is lost after deleteing these files?
When are the files in these folders created ?
When are the files in these folders needed?

Many thanks in advance for answering.
J.P.Peters Netherlands

Does Piwik automatically empty that folder on a preset time frame?

Allow me to add another question:

Can we set up a cron job to empty this directory:


/path-to/piwik-installation/tmp/templates_c

This folder should not get enormous. Do you know which folders take the most size?

You can safely delete the tmp/* folder content.

The two largest folders are:

piwik/tmp/latest
size: 19.95 Mb

piwik/tmp/templates_c
size: 2.0 Mb

Regards,
J.P.Peters

Following up to ask if it is OK to set up a cron job to empty this directory.

It’s OK to delete tmp/*