algernon: Index | Files

package cachemode

import ""

Package cachemode provides ways to deal with different cache modes


Package Files



const (
    Unset       = iota // cache mode has not been set
    On                 // cache everything
    Development        // cache everything, except Amber, Lua, GCSS and Markdown
    Production         // cache everything, except Amber and Lua
    Images             // cache images (png, jpg, gif, svg)
    Small              // only cache small files (<=64KB) // 64 * 1024
    Off                // cache nothing
    Default     = On

Possible cache modes


var (
    // Names is a map of cache mode setting string representations
    Names = map[Setting]string{
        Unset:       "unset",
        On:          "On",
        Development: "Development",
        Production:  "Production",
        Images:      "Images",
        Small:       "Small",
        Off:         "Off",

type Setting Uses

type Setting int

Setting represents a cache mode setting

func New Uses

func New(mode string) Setting

New creates a CacheModeSetting based on a variety of string options, like "on" and "off".

func (Setting) String Uses

func (cms Setting) String() string

String returns the name of the cache mode setting, if set

Package cachemode is imported by 1 packages. Updated 2017-10-11. Refresh now. Tools for package owners.