# Is there a way to control query expiration time in cache?

**URL:** <https://forums.percona.com/t/is-there-a-way-to-control-query-expiration-time-in-cache/715>\
**Category:** Other MySQL® Questions\
**Created:** [April 16, 2008, 12:59am UTC](https://forums.percona.com/t/is-there-a-way-to-control-query-expiration-time-in-cache/715 "2008-04-16T00:59:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hairroot](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@hairroot](https://forums.percona.com/u/hairroot)\
**Post date:** [April 16, 2008, 12:59am UTC](https://forums.percona.com/t/is-there-a-way-to-control-query-expiration-time-in-cache/715/1 "2008-04-16T00:59:42Z")

</div>

I am not quite sure when the query got to be expired in query cache.

Does mysql tick out the least recently used query when the cache is full?

my question is:  
can I let a query exist in the cache for a specific time(a day for example)?

thanks

---

<div class="post-metadata">

**Author:** ![safari](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@safari](https://forums.percona.com/u/safari)\
**Post date:** [April 16, 2008, 1:54am UTC](https://forums.percona.com/t/is-there-a-way-to-control-query-expiration-time-in-cache/715/2 "2008-04-16T01:54:57Z")

</div>

Hi,  
You should read about MySQL cache to have better understanding. Good start are at [URL][http://dev.mysql.com/doc/mysql/en/Query\_Cache.html[/URL]](http://dev.mysql.com/doc/mysql/en/Query_Cache.html%5B/URL%5D) and [http://dev.mysql.com/tech-resources/articles/mysql-query-cac](http://dev.mysql.com/tech-resources/articles/mysql-query-cac) he.html

I guess what you’re looking for is just a cache layer in between your application and (mysql) database server.

Please consider of using memcached for this type of caching.

Regards.
