메소드 | 설명 | |
---|---|---|
AddCacheBusterCached ( this helper, string relFilePath, string precalculatedCacheBuster = null ) : string |
This can be applied to any static file, e.g. an image, and it adds a cachebuster value to the file access. The format of how the cacheBuster value is added is controlled by the 'StaticFileCaching' in the BunderForBower.json file. If a checksum is calculated for the file it is cached locally, as it can take some time on large files.
|
|
GetChecksumBasedOnFileContent ( string absFilePath ) : string |
This calculate a checksum based on the content of the file. It actually uses a SHA256 Hash. This is heplful as it allows you to use the general Grunt 'build'command, which rebuilds everything, and the cache buster won't change unless the content changes.
|
|
HtmlCssCached ( this helper, string bundleName, bool forceState = null ) : System.Web.Mvc.MvcHtmlString |
This returns the CSS links using caching if forceState is null Note: this assumes that the CSS minified file is in the directory "~/css/"
|
|
HtmlScriptsCached ( this helper, string bundleName, bool forceState = null ) : System.Web.Mvc.MvcHtmlString |
This returns the script includes for a specific group using caching if forceState is null Note: this assumes that the JavaScript minified file is in the directory "~/js/"
|
메소드 | 설명 | |
---|---|---|
CreateHtmlIncludes ( this helper, string bundleName, CssOrJs cssOrJs, bool forceState = null ) : System.Web.Mvc.MvcHtmlString |
This returns the html to include either CSS or JavaScript files
|
|
GetBundlerForBowerCached ( HtmlHelper helper ) : |
||
GetChecksumFromRelPath ( string fileRelPath ) : string |
public static AddCacheBusterCached ( this helper, string relFilePath, string precalculatedCacheBuster = null ) : string | ||
helper | this | |
relFilePath | string | The relative path to the file inside the web application |
precalculatedCacheBuster | string | if null then a cachebusting value is calculated based on the file content (cached locally for performance) /// If you provide a precalculated a cachebuster value, say created at build time, then that will be used instead |
리턴 | string |
public static GetChecksumBasedOnFileContent ( string absFilePath ) : string | ||
absFilePath | string | |
리턴 | string |
public static HtmlCssCached ( this helper, string bundleName, bool forceState = null ) : System.Web.Mvc.MvcHtmlString | ||
helper | this | |
bundleName | string | The name of the setting.json property containing the list of Css file to include. /// defaults to main Css file |
forceState | bool | if not null then true forces into debug state and false forces production state |
리턴 | System.Web.Mvc.MvcHtmlString |
public static HtmlScriptsCached ( this helper, string bundleName, bool forceState = null ) : System.Web.Mvc.MvcHtmlString | ||
helper | this | |
bundleName | string | The name of the setting.json property containing the list of JavaScript file to include. /// defaults to main js file |
forceState | bool | if not null then true forces into debug state and false forces production state |
리턴 | System.Web.Mvc.MvcHtmlString |