Unosquare
    Show / Hide Table of Contents

    Class FileCache

    A cache where one or more instances of FileModule can store hashes and file contents.

    Inheritance
    Object
    FileCache
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: EmbedIO.Files
    Syntax
    public sealed class FileCache

    Fields

    DefaultMaxFileSizeKb

    The default value for the MaxFileSizeKb property.

    Declaration
    public const int DefaultMaxFileSizeKb = 200
    Field Value
    Type Description
    Int32

    DefaultMaxSizeKb

    The default value for the MaxSizeKb property.

    Declaration
    public const int DefaultMaxSizeKb = 10240
    Field Value
    Type Description
    Int32

    Properties

    Default

    Gets the default FileCache instance used by FileModule.

    Declaration
    public static FileCache Default { get; }
    Property Value
    Type Description
    FileCache

    MaxFileSizeKb

    Gets or sets the maximum size of a single cached file in kilobytes (1 kilobyte = 1024 bytes).

    A single file's contents may be present in a cache more than once, if the file is requested with different Accept-Encoding request headers. This property acts as a threshold for the uncompressed size of a file.

    The default value for this property is stored in the DefaultMaxFileSizeKb constant field.

    Setting this property to a value lower than 0 has the same effect as setting it to 0, in fact completely disabling the caching of file contents for this cache.

    This property cannot be set to a value higher than 2097151; in other words, it is not possible to cache files bigger than two Gigabytes (1 Gigabyte = 1048576 kilobytes) minus 1 kilobyte.

    Declaration
    public int MaxFileSizeKb { get; set; }
    Property Value
    Type Description
    Int32

    MaxSizeKb

    Gets or sets the maximum total size of cached data in kilobytes (1 kilobyte = 1024 bytes).

    The default value for this property is stored in the DefaultMaxSizeKb constant field.

    Setting this property to a value less lower han 1 has the same effect as setting it to 1.

    Declaration
    public int MaxSizeKb { get; set; }
    Property Value
    Type Description
    Int32

    Comments

    Back to top Copyright © 2017-2019 Unosquare