Package io.wcm.caravan.pipeline.cache
Class CacheControlUtils
- java.lang.Object
-
- io.wcm.caravan.pipeline.cache.CacheControlUtils
-
@ProviderType public final class CacheControlUtils extends Object
Cache control utilities aid to manage pipeline output cache control meta data.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getLowestMaxAge(JsonPipelineOutput... pipelineOutputs)
static int
getLowestMaxAge(Iterable<JsonPipelineOutput> pipelineOutputs)
static rx.Observable<JsonPipelineOutput>
zipWithLowestMaxAge(Iterable<JsonPipeline> pipelines, rx.functions.Func1<List<JsonPipelineOutput>,JsonPipelineOutput> zipFunc)
Aggregates multiple resources fetched with differentJsonPipeline
instances, into a singleJsonPipelineOutput
and ensures sure that the max-age Cache-Control-Header is set to the minimum value of all aggregated responses.static rx.Observable<JsonPipelineOutput>
zipWithLowestMaxAge(rx.Observable<JsonPipeline> pipelines, rx.functions.Func1<List<JsonPipelineOutput>,JsonPipelineOutput> zipFunc)
Aggregates multiple resources fetched with differentJsonPipeline
instances, into a singleJsonPipelineOutput
and ensures sure that the max-age Cache-Control-Header is set to the minimum value of all aggregated responses.
-
-
-
Method Detail
-
getLowestMaxAge
public static int getLowestMaxAge(Iterable<JsonPipelineOutput> pipelineOutputs)
- Parameters:
pipelineOutputs
- Pipeline outputs withmax-age
values- Returns:
- the lowest max-age value of all the given pipeline outputs
-
getLowestMaxAge
public static int getLowestMaxAge(JsonPipelineOutput... pipelineOutputs)
- Parameters:
pipelineOutputs
- Pipeline outputs withmax-age
values- Returns:
- the lowest max-age value of all the given pipeline outputs
-
zipWithLowestMaxAge
public static rx.Observable<JsonPipelineOutput> zipWithLowestMaxAge(rx.Observable<JsonPipeline> pipelines, rx.functions.Func1<List<JsonPipelineOutput>,JsonPipelineOutput> zipFunc)
Aggregates multiple resources fetched with differentJsonPipeline
instances, into a singleJsonPipelineOutput
and ensures sure that the max-age Cache-Control-Header is set to the minimum value of all aggregated responses.- Parameters:
pipelines
- an observable that emits MULTIPLEJsonPipeline
szipFunc
- a lambda that is given the list of allJsonPipelineOutput
s when they have been retrieved- Returns:
- a new observable that emits the aggregated JsonPipelineOutput with the correct max-age
-
zipWithLowestMaxAge
public static rx.Observable<JsonPipelineOutput> zipWithLowestMaxAge(Iterable<JsonPipeline> pipelines, rx.functions.Func1<List<JsonPipelineOutput>,JsonPipelineOutput> zipFunc)
Aggregates multiple resources fetched with differentJsonPipeline
instances, into a singleJsonPipelineOutput
and ensures sure that the max-age Cache-Control-Header is set to the minimum value of all aggregated responses.- Parameters:
pipelines
- theJsonPipeline
s to zipzipFunc
- a lambda that is given the list of allJsonPipelineOutput
s when they have been retrieved- Returns:
- a new observable that emits the aggregated JsonPipelineOutput with the correct max-age
-
-