https://bugzilla.wikimedia.org/show_bug.cgi?id=37360
Web browser: ---
Bug #: 37360
Summary: [SF] 2.4.2; [patch] Enable cache in SFAutocompleteAPI
Product: MediaWiki extensions
Version: master
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: Unprioritized
Component: SemanticForms
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Mobile Platform: ---
Created attachment 10695
--> https://bugzilla.wikimedia.org/attachment.cgi?id=10695
Allow cache to be used for "remote autocomplete"
## What
For each "remote autocomplete" request, the database goes into full-search mode
which causes various bottlenecks for the server and increases waiting time for
users.
## Solution
Introduce a switch ($sfgCacheAutocompleteValues) which allows to use standard
caching mechanism for results that use the same property_name / substring
combination.
This can help to increase the response time for users using field definitions
that uses "remote autocomplete" and decrease unnecessary database selects that
are initiated by each single "remote autocomplete" request.
This solution is for users who want to use "remote autocomplete" to be able to
fetch all possible results while at the same time don't have to sacrifice
performance for ached results.
## Implementation
see patch
The patch introduces two new globals
* $sfgCacheAutocompleteValues = true/false;
* $sfgCacheAutocompleteTimeOut = 60 * 60 * 6; (6h)
* $sfgFormCacheType is used to determine the cache type and is shared with
SForm cache.
## Invalidation of cache
For a sophisticated update logic of added/obsolete property/values pairs one
would have to use $wgHooks['SMWStore::updateDataBefore'] and
$wgHooks['smwDeleteSemanticData'] to track and invalidate pairs but since that
would take some more effort to implement sfgCacheAutocompleteTimeOut is used to
ensure cache objects are invalidate after a set time out.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l