Model = Props = Cache - sgml/signature GitHub Wiki
| Stack | Default Caching Behavior | Default Cache Backend | Cache Documentation URL |
|---|---|---|---|
| Laravel | Caching available but not enabled by default for app logic; framework config caching exists | File cache | https://laravel.com/docs/cache |
| Django | Caching framework included but disabled by default | Local-memory backend | https://docs.djangoproject.com/en/stable/topics/cache |
| Drupal | Page and render caching enabled by default in production; dynamic page cache enabled | Database-backed cache bins | https://www.drupal.org/docs/extending-drupal/cache-api |
| MediaWiki | Parser cache and message cache enabled by default | Database-backed cache | https://www.mediawiki.org/wiki/Manual:Caching |
| Symfony | Caching system available but not enabled by default for application logic | Filesystem cache | https://symfony.com/doc/current/cache.html |
| CiviCRM | Caching enabled by default for settings, metadata, and compiled templates | File-based cache and database-backed cache | https://docs.civicrm.org/dev/en/latest/framework/cache |
| TiddlyWiki | Entire wiki cached in memory by default | In-memory wiki store | https://tiddlywiki.com/#Caching |
Here's a brief overview of the caching policies for Nutch, Heritrix, and OpenSearchServer:
1. **Nutch**: Nutch does not have a specific caching policy built into its core functionality. However, it can be integrated with other caching solutions or frameworks to manage caching based on the specific needs of the deployment.
2. **Heritrix**: Heritrix does not have a built-in caching policy either. It focuses on web crawling and archiving, leaving caching policies to be managed by the systems that use Heritrix or by integrating with external caching solutions.
3. **OpenSearchServer**: OpenSearchServer has a more defined caching policy. It includes an **index request cache** designed to enhance search performance by storing the results of frequently executed search queries at the shard level. This cache is enabled by default and is particularly useful for read-heavy workloads. The cache is automatically invalidated at the configured refresh interval, ensuring that stale results are never returned. Users can configure the cache size and other parameters to optimize performance based on their specific needs.
Would you like more detailed information on configuring caching policies for any of these tools?
CacheFactory would be the most portable and easiest to debug:
function sharedCache($cacheFactory)
{
var sharedCache = $cacheFactory.get('sharedCache') ? $cacheFactory.get('sharedCache') : $cacheFactory('sharedCache');
return sharedCache;
}
function bar(sharedCache)
{
var data = {
firstName: 'John',
lastName: 'Smith',
pocket: 30
};
sharedCache.put('sharedCache', data);
}
bar.$inject = ['sharedCache', '$scope'];
sharedCache.$inject = ['$cacheFactory'];
angular.module('foo',[]);
angular.module('foo').constant('sharedCache', sharedCache);
angular.module('foo').run(bar);
Filters can read the data and output using ng-include and the templateCache. For example:
function bop(name)
{
var data = baz.data.get('sharedCache');
var tmpl = '';
try
{
tmpl = tmpl.concat('<h1>',data.firstName, '</h1>');
baz.tmpl.put(name, tmpl);
}
catch(e)
{
console.log(e);
}
}
function baz($templateCache, sharedCache)
{
baz.tmpl = $templateCache;
baz.data = sharedCache;
return bop;
}
baz.$inject=['$templateCache', 'sharedCache'];
angular.module('foo').filter('baz', baz);
With this markup:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="foo">
<div ng-include="'userContent' | baz"></div>
</div>
- Create a
sharedCachemethod that injectscacheFactory - Call
$cacheFactory('sharedCache')to initialize it
function sharedCache($cacheFactory)
{
var sharedCache = $cacheFactory.get('sharedCache') ? $cacheFactory.get('sharedCache') : $cacheFactory('sharedCache');
sharedCache.put('sharedCache', [])
return sharedCache;
}
- Reference the namespace:
var foo = () => { return $cacheFactory.get('sharedCache').get('sharedCache') }
- Create a sharedCache.js file in the
/storedirectory - Create a sharedCache key/value pair in the state method
export const state = () => ({
sharedCache: []
- Reference the namespace:
var foo = () => { return this.$store.state.sharedCache.sharedCache }