0

I have a table that contains the information about the current location(lat,lng) of user and from my php script i will query the table to find the other users that are surrounding him within some distant(like 50Miles). And each of the=is query may result large data set.

The above query is executed more in my app. But I know that the result contains same data for a user at least for 5 mins.

If i cache the sql query for 5 mins for particular user then i can read from cache instead of querying. After 5 mins i have to query the table as the other users location get updated.

How to solve the above situation ? Any caching techniques for php and mysql ?

Thanks, Seshachalam M

guy_fawkes
  • 947
  • 8
  • 31

1 Answers1

1

There is an option for query caching in application/config/database.php, Change the following lines.

$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';

In addition to this you can also see:
1. How to use memcached from codeigniter
2. http://ellislab.com/codeigniter/user-guide/libraries/caching.html

Community
  • 1
  • 1
Nil'z
  • 7,487
  • 1
  • 18
  • 28