User configuration caching #22
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
crumbcake/pyFileServer#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current implementation of user configuration files involves recursively scanning each level of the file system for
.dav_config.yamlfiles, parsing each of them, and then combining into a single final object. This process must be repeated for every web request and its complexity expands with the number of directories and configuration entries present.An ideal cache implementation will utilize file modification times and/or
inotifyevents for invalidation.User configuration file cachingto User configuration cachingThe general theory of operation here is to treat the configuration as a directed acyclic graph where each node represents a directory (or file if future changes to the configuration system add file-level options) and contains the computed value of all its parents combined into a single object.
When the configuration for any child is being resolved we only need to walk up the tree until we find an up-to-date node and overlay the child's configuration on top of it.
When the system detects that a configuration file has been modified, all it needs to do is delete the corresponding node from the graph, forcing any future query to recompute the configuration.