    001// Copyright 2013 The Apache Software Foundation
    002//
    003// Licensed under the Apache License, Version 2.0 (the "License");
    004// you may not use this file except in compliance with the License.
    005// You may obtain a copy of the License at
    006//
    007// http://www.apache.org/licenses/LICENSE-2.0
    008//
    009// Unless required by applicable law or agreed to in writing, software
    010// distributed under the License is distributed on an "AS IS" BASIS,
    011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    012// See the License for the specific language governing permissions and
    013// limitations under the License.
    014
    015package org.apache.tapestry5.internal.webresources;
    016
    017/**
    018 * Controls caching for {@link ResourceTransformerFactory} in <em>development mode</em>. In production mode, caching at this
    019 * level is not needed, because artifacts are also cached later in the pipeline. This caching is all about avoid unwanted
    020 */
    021public enum CacheMode
    022{
    023    /**
    024     * Cache the content on the file system, in the directory defined by {@link org.apache.tapestry5.webresources.WebResourcesSymbols#CACHE_DIR}.
    025     * This allows compilation to be avoided even after a restart, as long as the source file has not changed. This only works
    026     * for compilations that operate on a single file (such as CoffeeScript, but not Less, which has an {@code @import} statement).
    027     */
    028    SINGLE_FILE,
    029
    030    /**
    031     * The source may be multiple files (e.g., Less). Cache in memory, and invalidate the cache if any of the multiple
    032     * file's content changes.
    033     */
    034    MULTIPLE_FILE,
    035
    036    /**
    037     * Do no caching. This is appropriate for extremely cheap compilers.
    038     */
    039    NONE;
    040}