[aur-dev] [PATCH 3/5] Cache all front page stats in APC if available
Use the APC cache to store all of the counts and the recently updated
package list in a cache, which cuts down on the number of database queries
needed. If the data isn't perfectly up to date we will survive.
Signed-off-by: Dan McGee
No need to call this function way too often, especially when on the package
list page where it could be called up to once per row.
Signed-off-by: Dan McGee
Just like the previous patch for account_from_sid() over-usage.
Signed-off-by: Dan McGee
subject s/und/uid/
On Mon, Dec 29, 2008 at 10:36 PM, Dan McGee
Just like the previous patch for account_from_sid() over-usage.
Signed-off-by: Dan McGee
--- web/html/pkgsubmit.php | 12 +++++++----- web/lib/pkgfuncs.inc | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-)
On Mon, Dec 29, 2008 at 10:36:07PM -0600, Dan McGee wrote:
Just like the previous patch for account_from_sid() over-usage.
Signed-off-by: Dan McGee
--- web/html/pkgsubmit.php | 12 +++++++----- web/lib/pkgfuncs.inc | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 2ebae89..03acbed 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -272,6 +272,7 @@ function package_details($id=0, $SID="") { global $_REQUEST; global $pkgsearch_vars; $atype = account_from_sid($SID); + $uid = uid_from_sid($sid);
Pushed with a small fix. $uid should be set with: $uid = uid_from_sid($SID);
On Mon, Dec 29, 2008 at 10:36:06PM -0600, Dan McGee wrote:
No need to call this function way too often, especially when on the package list page where it could be called up to once per row.
Signed-off-by: Dan McGee
--- web/lib/pkgfuncs.inc | 13 ++++++------- web/template/header.php | 4 ++-- web/template/pkg_search_results.php | 3 ++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/template/header.php b/web/template/header.php index dcf99f3..5b48cd6 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -49,8 +49,8 @@ if (isset($_COOKIE["AURSID"])) { <li><a href="pkgsubmit.php"><?php print __("Submit"); ?></a></li> <li><?php print __("My Packages"); ?></a></li>
Pushed with one added line: $SID = $_COOKIE['AURSID']; Since SID wasn't being set in header.php.
On Sun, Jan 4, 2009 at 1:11 PM, Loui Chang
On Mon, Dec 29, 2008 at 10:36:06PM -0600, Dan McGee wrote:
No need to call this function way too often, especially when on the package list page where it could be called up to once per row.
Signed-off-by: Dan McGee
--- web/lib/pkgfuncs.inc | 13 ++++++------- web/template/header.php | 4 ++-- web/template/pkg_search_results.php | 3 ++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/template/header.php b/web/template/header.php index dcf99f3..5b48cd6 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -49,8 +49,8 @@ if (isset($_COOKIE["AURSID"])) { <li><a href="pkgsubmit.php"><?php print __("Submit"); ?></a></li> <li><?php print __("My Packages"); ?></a></li>
Pushed with one added line: $SID = $_COOKIE['AURSID'];
Since SID wasn't being set in header.php.
Great catch, thanks! -Dan
participants (3)
-
Dan McGee
-
Dan McGee
-
Loui Chang