maybe you could use the backgroundrb plugin
it can run ruby code in socalled "worker classes" (who have access to
your models) in independent threats, therefore running alongside your
rails application and surviving the request-response cycle.
1) Create a Worker that, on startup, gets all (sub)categories, maybe in
an instance variable. Those will be available until the Worker is
deleted/restarted. (unless my lack of ruby knowledge lead to an error
of thinking here)
2) add a method to the Worker that can return the categories instance
variable to your rails app.
3) add a method to the Worker to destroy & rebuild your category list,
then you can call this method when you add/remove/change a category in
sounds a bit weird? read on here: