Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

Item11436: HtpasswdUser creates a cache, make it a global cache

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
HtPasswdUser caches the contents of the htpasswd file into a local variable that is released for every transaction. The cache is valuable, especially for rest applications. view of a topic like JQueryAjaxHelper hits the PasswordManager 20-30 times.

As long as the code goes to the effort of creating a cache, it might as well be a global cache so that in FCGI / mod_perl environments, the file is only read during initialization, and after password changes instead of once for each transaction.

The only time to not enable the global cache:
  • It adds no value unless you are running FCGI. FastCGI or mod_perl
  • If you are sharing a single foswiki with multiple virtual hosts, the cache should remain per session instead of global.

See Tasks.Item11409 for related changes.

-- GeorgeClark - 11 Jan 2012

Hi George, is it okay if I cherry-pick your commit over to trunk for UnitTestContrib?

-- PaulHarvey - 19 Jan 2012
 
Topic revision: r10 - 11 Apr 2012, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License