?
avatar stAn47
stAn47
1 Jun 2016

Steps to reproduce the issue

applications that are using joomla's cache handler:

$cache = JFactory::getCache('my_key','callback');
$cache->setCaching(true);
$cache->call( array( 'MyClass', 'MyFunction' ),$param1,$param2,$param3);

the cache handlers in joomla do usleep on a first round even when the key hasn't yet been created within the cache handlers.

related joomla core files with usleep:
\libraries\joomla\cache\storage\file.php
\libraries\joomla\cache\cache.php

  • other handlers

original code in file.php
[code]
usleep(100);
$data_lock = @flock($_fileopen, LOCK_EX);
[/code]
suggested code (to usleep only after the first round):
[code]
$data_lock = @flock($_fileopen, LOCK_EX);
if ($data_lock === false) {
usleep(100);
}
[/code]

since locking is handled in the handler (file and others) i do not see the point to delay script with usleep in the main cache class:
\libraries\joomla\cache\cache.php

Expected result

adding Nx 2x 100 microsends to the page load depending on N number of times of calling the cache function while having an empty cache.

Actual result

slow site, lower SEO

System information (as much as possible)

php 5.5 on joomla 3.5.1

Additional comments

avatar stAn47 stAn47 - open - 1 Jun 2016
avatar brianteeman brianteeman - change - 1 Jun 2016
Category Cache
avatar brianteeman brianteeman - change - 1 Jun 2016
Priority Urgent Medium
avatar brianteeman
brianteeman - comment - 1 Jun 2016

Reset priority according to documented standards https://docs.joomla.org/Priority


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10706.

avatar zero-24
zero-24 - comment - 1 Jun 2016

As you have allready code you can submit them as pull request with test instructions ????

If you need help please see here: https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

avatar zero-24 zero-24 - change - 30 Jul 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-07-30 20:36:43
Closed_By zero-24
avatar joomla-cms-bot joomla-cms-bot - close - 30 Jul 2016
avatar zero-24
zero-24 - comment - 30 Jul 2016

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/10706

avatar zero-24
zero-24 - comment - 30 Jul 2016

Closing as we have a PR for testing. Thanks @csthomas


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10706.

avatar csthomas
csthomas - comment - 24 Aug 2016

PR #10767 is waiting for tests. Is anyone interested?

Add a Comment

Login with GitHub to post a comment