Reference documentation and code samples for the Google Auth Library Client class GCECache.
A class to implement caching for calls to GCECredentials::onGce. This class
is used automatically when you pass a Psr\Cache\CacheItemPoolInterface
cache object to ApplicationDefaultCredentials::getCredentials.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Google Auth Library Client - Class GCECache (1.47.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.47.1 (latest)](/php/docs/reference/auth/latest/GCECache)\n- [1.47.0](/php/docs/reference/auth/1.47.0/GCECache)\n- [1.46.0](/php/docs/reference/auth/1.46.0/GCECache)\n- [1.45.2](/php/docs/reference/auth/1.45.2/GCECache) \nReference documentation and code samples for the Google Auth Library Client class GCECache.\n\nA class to implement caching for calls to GCECredentials::onGce. This class\nis used automatically when you pass a `Psr\\Cache\\CacheItemPoolInterface`\ncache object to `ApplicationDefaultCredentials::getCredentials`. \n\n $sysvCache = new Google\\Auth\\SysvCacheItemPool();\n $creds = Google\\Auth\\ApplicationDefaultCredentials::getCredentials(\n $scope,\n null,\n null,\n $sysvCache\n );\n\nNamespace\n---------\n\nGoogle \\\\ Auth\n\nMethods\n-------\n\n### __construct\n\n### onGce\n\nCaches the result of onGce so the metadata server is not called multiple\ntimes.\n\nConstants\n---------\n\n### GCE_CACHE_KEY\n\n Value: 'google_auth_on_gce_cache'"]]