# Ruby cache

**URL:** <https://www.ruby-forum.com/t/ruby-cache/121250>\
**Category:** Ruby\
**Created:** [November 26, 2007, 2:26am UTC](https://www.ruby-forum.com/t/ruby-cache/121250 "2007-11-26T02:26:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 26, 2007, 2:26am UTC](https://www.ruby-forum.com/t/ruby-cache/121250/1 "2007-11-26T02:26:40Z")

</div>

I am trying to improve the performance of a very simple web  
application. The web application let’s you choose a library from a  
drop down box. then it goes to the database and loads the name and  
birth places of all entries in the authors table.  
then it gecodes the birthplaces of all the authors, computes their  
relative distance to the library and show the top 10. any ideas on how  
to do caching to speed things up?

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 26, 2007, 3:56am UTC](https://www.ruby-forum.com/t/ruby-cache/121250/2 "2007-11-26T03:56:42Z")

</div>

you can cache the geocode locations in the database itself and calculate  
the  
distances on the fly. That should speed up things considerably. As soon  
as  
you add/update a new/old author call geocoding function to populate lat,  
long fields in the  
db.
