Update matrix caching functions