-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve page and data registry cache #43
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add loadCache() method to allow just in time loading and refreshing of the cache - Add buildCache() method to allow rebuilding the complete cache on demand - Improve implementation for performance by only storing a cache file per root folder not per file - Add cache_time config option to allow defining the cache expiration time in seconds
- Add loadCache() method to allow just in time loading and refreshing of the cache - Add buildCache() method to allow rebuilding the complete cache on demand - Improve implementation for performance by only storing the cache in one file - Add cache_time config option to allow defining the cache expiration time in seconds
…ngs to 'http_cache'
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the page and data cache.
Page registry cache
The page registry cache is stored in a single file, prefixed with 'page_'. The file contains the files structure and the file metadata as a php array. The actual content of the file is not cached.
Added an additional
ComPagesPageRegistry::buildCache()
method to programmatically build the cache, for example during a deploy.Added a
ComPagesPageRegistry::cache_time
config option to allow defining the cache expiration time in seconds, default 606024 or 1 day.Data cache
The data registry cache stores a file per root data folder, prefixed with 'data_'. The file contains the data as a php array.
Added an additional
ComPagesDataRegistry::buildCache()
method to programmatically build the cache, for example during a deploy.Added a
ComPagesDataRegistry::cache_time
config option to allow defining the cache expiration time in seconds, default 606024 or 1 day.Configuration
Added following config options:
page_cache:
JDEBUG ? false : true
page_cache_time:
60*60*24 //1d
page_cache_path: /joomlatools-pages/cache
data_cache:
JDEBUG ? false : true
data_cache_time:
60*60*24, //1d
data_cache_path: /joomlatools-pages/cache
template_cache:
JDEBUG ? false : true
template_cache_path:
JPATH_ADMINISTRATOR.'/cache/koowa.templates'
Renamed cache and cache_time options to:
http_cache:
false
http_cache_time:
7200
http_cache_path: /joomlatools-pages/cache
Notes:
This PR also includes a change in the way data works. If a data file has the same name as the folder it's part of, the file will not result in an additional level in the data collection. If the file has a different name the key of the level will be the name of the file
This issue also adds an additional
ComPagesDataObject::flatten()
method which is capable of flatting the first level of a data object.This PR also refactors the http cache to use a custom file cache and no longer make use of the Joomla JCache API. This offers additional performance benefits as http cache objects are now also automatically stored in opcode cache.