# Refresh cached data in CRON job

**URL:** https://forum.mautic.org/t/refresh-cached-data-in-cron-job/7468
**Category:** Product Support
**Created:** [February 10, 2017, 5:08pm UTC](https://forum.mautic.org/t/refresh-cached-data-in-cron-job/7468 "2017-02-10T17:08:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![florian.nicolas](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@florian.nicolas](https://forum.mautic.org/u/florian.nicolas)
#### Post date: [February 10, 2017, 5:08pm UTC](https://forum.mautic.org/t/refresh-cached-data-in-cron-job/7468/1 "2017-02-10T17:08:05Z")

</div>

Hi !  
  
  
  
I think I understand that mautic have cached datas on database to speedup the load of some charts and tables.  
  
We can setup the "Cached data timeout " in Mautic configuration.  
  
  
  
My problem is, each time the cache need to be refreshed, Mautic is very slow to load.  
  
It take more than 5 min to display the dashboard.  
  
  
  
  
  
My question is simple : is it possible to refresh cached data in a CRON job ?  
  
  
  
Otherwise, how to improve the cache refresh process ?

---

<div class="post-metadata">

### Author: ![florian.nicolas](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@florian.nicolas](https://forum.mautic.org/u/florian.nicolas)
#### Post date: [February 10, 2017, 5:08pm UTC](https://forum.mautic.org/t/refresh-cached-data-in-cron-job/7468/2 "2017-02-10T17:08:05Z")

</div>

Hi !

I think I understand that mautic have cached datas on database to speedup the load of some charts and tables.  
We can setup the "Cached data timeout " in Mautic configuration.

My problem is, each time the cache need to be refreshed, Mautic is very slow to load.  
It take more than 5 min to display the dashboard.

My question is simple : is it possible to refresh cached data in a CRON job ?

Otherwise, how to improve the cache refresh process ?

---

<div class="post-metadata">

### Author: ![Petykemano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petykemano/32/161_2.png) [@Petykemano](https://forum.mautic.org/u/Petykemano)
#### Post date: [May 11, 2017, 3:40pm UTC](https://forum.mautic.org/t/refresh-cached-data-in-cron-job/7468/3 "2017-05-11T15:40:54Z")

</div>

I’ve also noticed that the dashboard is very slow. It renders the application unusable for every day use.

I tried to figure out the reason for the slowness. Queries that sum data from ma\_page\_hits are usually very slow. Dwell times chart is a good example.

I tried to tune mysql to better handle datetime range query, but with no luck. Thing is mysql refuses to use index on the date\_hit field because the optimizer thinks table scan will bring better results than scanning the index.
