MCPcopy Create free account
hub / github.com/Rello/analytics / getCacheMetadata

Method getCacheMetadata

lib/Datasource/ExternalJson.php:132–141  ·  view source on GitHub ↗
($option)

Source from the content-addressed store, hash-verified

130 }
131
132 private function getCacheMetadata($option): array {
133 $currentCacheKey = 'json-' . (string)floor(time() / self::CACHE_TTL_SECONDS);
134 $clientCacheKey = isset($option['cacheKey']) ? trim((string)$option['cacheKey'], '"') : '';
135
136 return [
137 'cacheable' => true,
138 'key' => $currentCacheKey,
139 'notModified' => ($clientCacheKey !== '' && $clientCacheKey === $currentCacheKey),
140 ];
141 }
142
143 /**
144 * Parses JSON data based on the provided options and raw input.

Callers 1

readDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected