I may not understand the issue, but perhaps if Rabl supported a file_context helper alongside root_object that could look the first few lines of the backtrace, see the file context it's within and then use that as part of the cache string. That seems like one potential way to get access to what __FILE__ is giving and then let every Spree RABL be more copy/paste proof.