MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / initOperationResponseCaches

Function initOperationResponseCaches

backend/pkg/httpserver/cache.go:164–221  ·  view source on GitHub ↗

initOperationResponseCaches initializes and configures each operationResponseCache instance within the operationResponseCaches struct. While each cache instance uses the same underlying RawBytesDataCacher for storage, they operate independently and are specialized for their respective API operations

(dataCacher RawBytesDataCacher,
	routeCacheOptions RouteCacheOptions)

Source from the content-addressed store, hash-verified

162// While each cache instance uses the same underlying RawBytesDataCacher for storage,
163// they operate independently and are specialized for their respective API operations.
164func initOperationResponseCaches(dataCacher RawBytesDataCacher,
165 routeCacheOptions RouteCacheOptions) *operationResponseCaches {
166 return &operationResponseCaches{
167 getFeatureCache: operationResponseCache[
168 backend.GetFeatureRequestObject,
169 backend.GetFeature200JSONResponse,
170 ]{cacher: dataCacher, operationID: "getFeature", overrideCacheOptions: nil},
171
172 listFeaturesCache: operationResponseCache[
173 backend.ListFeaturesRequestObject,
174 backend.ListFeatures200JSONResponse,
175 ]{cacher: dataCacher, operationID: "listFeatures", overrideCacheOptions: nil},
176
177 getFeatureMetadataCache: operationResponseCache[
178 backend.GetFeatureMetadataRequestObject,
179 backend.GetFeatureMetadata200JSONResponse,
180 ]{cacher: dataCacher, operationID: "getFeatureMetadata", overrideCacheOptions: nil},
181
182 listFeatureWPTMetricsCache: operationResponseCache[
183 backend.ListFeatureWPTMetricsRequestObject,
184 backend.ListFeatureWPTMetrics200JSONResponse,
185 ]{cacher: dataCacher, operationID: "listFeatureWPTMetrics", overrideCacheOptions: nil},
186
187 listChromeDailyUsageStatsCache: operationResponseCache[
188 backend.ListChromeDailyUsageStatsRequestObject,
189 backend.ListChromeDailyUsageStats200JSONResponse,
190 ]{cacher: dataCacher, operationID: "listChromeDailyUsageStats", overrideCacheOptions: nil},
191
192 listAggregatedFeatureSupportCache: operationResponseCache[
193 backend.ListAggregatedFeatureSupportRequestObject,
194 backend.ListAggregatedFeatureSupport200JSONResponse,
195 ]{cacher: dataCacher, operationID: "listAggregatedFeatureSupport",
196 overrideCacheOptions: routeCacheOptions.AggregatedFeatureStatsOptions},
197
198 ListMissingOneImplementationCountsCache: operationResponseCache[
199 backend.ListMissingOneImplementationCountsRequestObject,
200 backend.ListMissingOneImplementationCounts200JSONResponse,
201 ]{cacher: dataCacher, operationID: "ListMissingOneImplementationCounts",
202 overrideCacheOptions: routeCacheOptions.AggregatedFeatureStatsOptions},
203
204 listAggregatedWPTMetricsCache: operationResponseCache[
205 backend.ListAggregatedWPTMetricsRequestObject,
206 backend.ListAggregatedWPTMetrics200JSONResponse,
207 ]{cacher: dataCacher, operationID: "listAggregatedWPTMetrics", overrideCacheOptions: nil},
208
209 listAggregatedBaselineStatusCountsCache: operationResponseCache[
210 backend.ListAggregatedBaselineStatusCountsRequestObject,
211 backend.ListAggregatedBaselineStatusCounts200JSONResponse,
212 ]{cacher: dataCacher, operationID: "listAggregatedBaselineStatusCounts",
213 overrideCacheOptions: routeCacheOptions.AggregatedFeatureStatsOptions},
214
215 listGlobalSavedSearchesCache: operationResponseCache[
216 backend.ListGlobalSavedSearchesRequestObject,
217 backend.ListGlobalSavedSearches200JSONResponse,
218 ]{cacher: dataCacher, operationID: "listGlobalSavedSearches",
219 overrideCacheOptions: routeCacheOptions.AggregatedFeatureStatsOptions},
220 }
221}

Calls

no outgoing calls