How do you share pre-calculated data between calls to a Rails web service?
- by Nigel Thorne
I have a Rails app that allows users to build up a network structure and then ask questions about how to navigate around it.
When adding nodes and connections these are just saved to the database. At the point you make a query of the network I calculate the shortest path from any node to any other node.
Constructing this in memory takes a while (something I need to fix), but once it is there, you can instantly get the answer to any of these path questions.
The question is... How do I share this network between calls to the website, so each request doesn't regenerate the paths network each time?
Note: I am hosting this on apache server using passenger (mod ruby)
Thoughts?