Add generic caching functions