Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.2, 4.3
-
None
Description
Symptoms
Requesting certain JavaScript resources can be quite slow. The problem is even worse on instances where plugins add a lot of JavaScript to the batches or where user lookups are slow.
Technical Explanation
When certain resources are requested, the thread local caches does not get initialised because the UrlRewriteFilter forwards the request and the ThreadLocalCacheFilter never runs.
This causes certain calls (such as getLocale in DefaultLocaleManager) not to use any caching. Then, transformers such as the i18n JavaScript transformer, which use things like the LocaleManager end up running very slowly because they end up doing an uncached getUser call for each and every instance of getText in the JavaScript.
Fix
The fix is to edit the web.xml file and move the following snippet:
<filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/s/*</url-pattern> </filter-mapping>
down so that it is right above this line:
<!-- Plugins 2.5 filter changes -->
If the log messages continue upgrading to Confluence 5.0 or higher will fix it, or if that is not an option, you can add this to your log4j.properies file and add:
log4j.logger.com.atlassian.confluence.cache.ThreadLocalCache=ERROR
To avoid restarting Confluence for it to pick up the change, you should also add this to your "Logging and Profiling" admin page:
Class/Package Name | com.atlassian.confluence.cache.ThreadLocalCache |
---|---|
New Level | ERROR |
Attachments
Issue Links
- causes
-
CONFSERVER-27023 timeout: timeout error in quick comments editor
- Closed
- relates to
-
CONFSERVER-27360 ThreadLocalCache is not initialised warnings with Activity Stream Gadget in Confluence
- Closed