Class CacheControlUtils


  • @ProviderType
    public final class CacheControlUtils
    extends Object
    Cache control utilities aid to manage pipeline output cache control meta data.
    • Method Detail

      • getLowestMaxAge

        public static int getLowestMaxAge​(Iterable<JsonPipelineOutput> pipelineOutputs)
        Parameters:
        pipelineOutputs - Pipeline outputs with max-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 with max-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 different JsonPipeline instances, into a single JsonPipelineOutput 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 MULTIPLE JsonPipelines
        zipFunc - a lambda that is given the list of all JsonPipelineOutputs when they have been retrieved
        Returns:
        a new observable that emits the aggregated JsonPipelineOutput with the correct max-age