From 25319188b043ec5530b3492872c703b774582306 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 28 Apr 2005 22:34:42 +0000 Subject: [PATCH] Added a cache disabling config option for developers who are testing performance. --- docs/changelog/6.x.x.txt | 2 ++ etc/WebGUI.conf.original | 8 +++++++- lib/WebGUI/Asset.pm | 12 +++++++++++- lib/WebGUI/Cache/FileCache.pm | 1 + lib/WebGUI/Cache/Memcached.pm | 1 + 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 8087f590a..c3d9e9fbd 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -35,6 +35,8 @@ - Added missing international entries for Navigation. - fix [1177858] lib/WebGUI/i18n/English/Macros.pm can not translated - Added the notion of utility assets and moved the Template asset into it. + - Added a cache disabling config option for developers who are testing + performance. - fix [ 1190834 ] Pagination of event calendar does not work for firefox diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index fc943f918..8eedc75cc 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -36,10 +36,16 @@ uploadsPath = /data/WebGUI/www/uploads # Support for the memcached distributed caching system. # See http://www.danga.com/memcached/ for details on memcached. -# Uncomment this and point it to your memcached server(s). +# Uncomment this and point it to your memcached server(s). Use a +# comma seperated list for multiple servers. # memcached_servers = 10.0.0.6:11211 +# Set this to 1 to disable WebGUI's caching subsystems. This is +# mainly useful for developers. + +disableCache = 0 + # The database connection string. It usually takes the form of # DBI::;host= diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 54df5c4f2..b0d3da116 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -1660,7 +1660,17 @@ sub getToolbar { .cutIcon('func=cut',$self->get("url")) .copyIcon('func=copy',$self->get("url")); $toolbar .= shortcutIcon('func=createShortcut',$self->get("url")) unless ($self->get("className") =~ /Shortcut/); - return ''.$self->getName.''.$toolbar; + WebGUI::Style::setLink($session{config}{extrasURL}.'/contextMenu/contextMenu.css', {rel=>"stylesheet",type=>"text/css"}); + WebGUI::Style::setScript($session{config}{extrasURL}.'/contextMenu/contextMenu.js', {type=>"text/javascript"}); + #return ''.$self->getName.''.$toolbar; + return ''.$toolbar; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Cache/FileCache.pm b/lib/WebGUI/Cache/FileCache.pm index f3e211c13..c9fe8ae67 100644 --- a/lib/WebGUI/Cache/FileCache.pm +++ b/lib/WebGUI/Cache/FileCache.pm @@ -102,6 +102,7 @@ Retrieve content from the filesystem cache. =cut sub get { + return undef if ($session{config}{disableCache}); return $_[0]->{_cache}->get($_[0]->{_key}); } diff --git a/lib/WebGUI/Cache/Memcached.pm b/lib/WebGUI/Cache/Memcached.pm index 5e1e910ec..e8ba3b23e 100644 --- a/lib/WebGUI/Cache/Memcached.pm +++ b/lib/WebGUI/Cache/Memcached.pm @@ -111,6 +111,7 @@ Retrieve content from the filesystem cache. =cut sub get { + return undef if ($session{config}{disableCache}); return $_[0]->{_cache}->get($_[0]->{_key}); }