Caches documents between executions.
- Namespace
- Statiq
.Core - Interfaces
- Base Types
-
- object
- Module
- ParentModule
graph BT
Type-->Base0["ParentModule"]
click Base0 "/api/Statiq.Common/ParentModule"
Base0-->Base1["Module"]
click Base1 "/api/Statiq.Common/Module"
Base1-->Base2["object"]
Type-.->Interface0["IModule"]
click Interface0 "/api/Statiq.Common/IModule"
Type-.->Interface1["IEnumerable<IModule>"]
Type-.->Interface2["IEnumerable"]
Type-.->Interface3["IDisposable"]
Type["CacheDocuments"]
class Type type-node
Syntax
public class CacheDocuments : ParentModule, IModule, IEnumerable<IModule>, IEnumerable, IDisposable
Remarks
This module will execute child modules and cache the output documents. On following
executions, the cached documents will be output if the input documents (as well as
any other specified documents) match the original inputs (as defined by a hash of
the document content and metadata). Using this module can greatly improve performance
on re-execution after making changes in preview mode.
In general, caching works best when there is a one-to-one relationship between input and
output documents. Modules that aggregate documents into groups such as
CreateTree
should not be used as child modules of the cache module. Instead they should appear after
the cache module and operate on the cached outputs.
The input documents to child modules will consist only of cache misses. If a child module needs
to access the full set of input documents, it can do so via Parent
.
Constructors
Name | Summary |
---|---|
CacheDocuments |
Properties
Name | Property Type | Summary |
---|---|---|
Children | ModuleList |
The children of this module.
Inherited from ParentModule
|
Methods
Name | Return Value | Summary |
---|---|---|
Add |
void |
Adds modules as a child of this module.
Inherited from ParentModule
|
AfterExecution |
void |
Called after each module execution.
Inherited from Module
|
AfterExecutionAsync |
Task |
Called after each module execution.
Inherited from Module
|
BeforeExecution |
void |
Called before each module execution.
Inherited from Module
|
BeforeExecutionAsync |
Task |
Called before each module execution.
Inherited from Module
|
Dispose |
void | |
ExecuteAsync |
Task |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
|
ExecuteContextAsync |
Task |
Executes the module once for all input documents.
|
ExecuteInputAsync |
Task |
Executes the module.
Inherited from Module
|
Finally |
void |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
FinallyAsync |
Task |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
GetEnumerator |
IEnumerator |
Inherited from ParentModule
|
Invalidate |
CacheDocuments |
Specifies whether a particular document should be invalidated.
|
With |
CacheDocuments |
Specifies additional documents that a document cache entry should depend on.
|
WithoutSourceMapping |
CacheDocuments |
Specifies whether source mapping of inputs to outputs should be used (the default is to use source mapping).
|
With |
CacheDocuments |
Sets the pipelines that the cache depends on. If any document in a dependent pipeline
changes, the entire cache is invalidated.
|