Module rocket_file_cache::priority_function
[−]
[src]
Functions
ACCESS_PRIORITY_FUNCTION |
This priority function will value files in the cache based solely on the number of times the file is accessed. |
DEFAULT_PRIORITY_FUNCTION |
The default priority function used for determining if a file should be in the cache This function takes the square root of the size of the file times the number of times it has been accessed. This should give some priority to bigger files, while still allowing some smaller files to enter the cache. |
NORMAL_PRIORITY_FUNCTION |
Priority is calculated as size * access count. |
SMALL_FILES_ACCESS_PRIORITY_FUNCTION |
Favor small files. The smaller the file, the higher priority it will have. Does take into account the number of accesses the file has. |
SMALL_FILES_PRIORITY_FUNCTION |
Favor small files. The smaller the file, the higher priority it will have. Does not take into account the number of accesses the file has. |
Type Definitions
PriorityFunction |
Custom type of function that is used to determine how to add files to the cache. The first term will be assigned the access count of the file in question, while the second term will be assigned the size (in bytes) of the file in question. The result will represent the priority of the file to remain in or be added to the cache. The files with the largest priorities will be kept in the cache. |