C# Class Sage.Views.ViewCache

Implements a simple cache store for saving and restoring transformed views.
Show file Open project: igorfrance/sage

Public Methods

Method Description
Get ( string viewPath, string groupName = null ) : string

Gets the specified view path.

GetLastModified ( string path, string groupName = null ) : DateTime?

Gets the last modified date of the specified path.

Has ( string viewPath, string groupName = null ) : bool

Determines whether the specified view path has been cached, and is still valid.

Save ( string viewPath, string content, string groupName = null ) : bool

Saves the specified content to the cache.

ViewCache ( SageContext context ) : System

Initializes a new instance of the ViewCache class.

Private Methods

Method Description
GetCachePath ( string viewPath, string groupName = null ) : string

Method Details

Get() public method

Gets the specified view path.
public Get ( string viewPath, string groupName = null ) : string
viewPath string The view path.
groupName string Optional name of the cache group that the belongs to.
return string

GetLastModified() public method

Gets the last modified date of the specified path.
public GetLastModified ( string path, string groupName = null ) : DateTime?
path string The source path of the cached item.
groupName string Optional name of the cache group that the belongs to.
return DateTime?

Has() public method

Determines whether the specified view path has been cached, and is still valid.
public Has ( string viewPath, string groupName = null ) : bool
viewPath string The view path to check.
groupName string Optional name of the cache group that the belongs to.
return bool

Save() public method

Saves the specified content to the cache.
public Save ( string viewPath, string content, string groupName = null ) : bool
viewPath string The view path.
content string The content.
groupName string Optional name of the cache group that the belongs to.
return bool

ViewCache() public method

Initializes a new instance of the ViewCache class.
public ViewCache ( SageContext context ) : System
context SageContext The current context.
return System