WP Super Cache - Version 0.8.4

Version Description

Download this release

Release Info

Developer donncha
Plugin Icon 128x128 WP Super Cache
Version 0.8.4
Comparing to
See all releases

Code changes from version 0.8.3 to 0.8.4

Files changed (4) hide show
  1. Changelog.txt +17 -0
  2. readme.txt +1 -1
  3. wp-cache-phase2.php +10 -2
  4. wp-cache.php +11 -8
Changelog.txt CHANGED
@@ -1,3 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  2008-10-08 16:04 donncha
2
 
3
  * readme.txt, wp-cache.php: Bump version numbers to 0.8.3
1
+ 2008-10-22 15:55 donncha
2
+
3
+ * readme.txt, wp-cache.php: Bump version number to 0.8.4
4
+
5
+ 2008-10-11 22:10 donncha
6
+
7
+ * wp-cache-phase2.php: Update the time of last gc
8
+
9
+ 2008-10-10 11:54 donncha
10
+
11
+ * wp-cache-phase2.php, wp-cache.php: Change garbage collection
12
+ parameters to time rather than hits
13
+
14
+ 2008-10-08 16:06 donncha
15
+
16
+ * Changelog.txt: Updated changelog
17
+
18
  2008-10-08 16:04 donncha
19
 
20
  * readme.txt, wp-cache.php: Bump version numbers to 0.8.3
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache
4
  Tested up to: 2.6.2
5
- Stable tag: 0.8.3
6
  Requires at least: 2.2
7
 
8
  A very fast caching engine for WordPress that produces static html files.
2
  Contributors: donncha
3
  Tags: performance,caching,wp-cache
4
  Tested up to: 2.6.2
5
+ Stable tag: 0.8.4
6
  Requires at least: 2.2
7
 
8
  A very fast caching engine for WordPress that produces static html files.
wp-cache-phase2.php CHANGED
@@ -446,9 +446,17 @@ function wp_cache_shutdown_callback() {
446
  }
447
 
448
  if( !isset( $wp_cache_gc ) )
449
- $wp_cache_gc = 1000;
450
- if( mt_rand( 0, $wp_cache_gc ) != 1 )
 
 
 
 
 
 
 
451
  return;
 
452
 
453
  // we delete expired files, using a wordpress cron event
454
  // since flush() does not guarantee hand-off to client - problem on Win32 and suPHP
446
  }
447
 
448
  if( !isset( $wp_cache_gc ) )
449
+ $wp_cache_gc = 3600;
450
+ $last_gc = get_option( "wpsupercache_gc_time" );
451
+
452
+ if( !$last_gc ) {
453
+ update_option( 'wpsupercache_gc_time', time() );
454
+ return;
455
+ }
456
+
457
+ if( $last_gc > ( time() - $wp_cache_gc ) ) // do garbage collection once every X hours.
458
  return;
459
+ update_option( 'wpsupercache_gc_time', time() );
460
 
461
  // we delete expired files, using a wordpress cron event
462
  // since flush() does not guarantee hand-off to client - problem on Win32 and suPHP
wp-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Super Cache
4
  Plugin URI: http://ocaoimh.ie/wp-super-cache/
5
  Description: Very fast caching module for WordPress. Once activated, you must <a href="options-general.php?page=wpsupercache">enable the cache</a>. Based on WP-Cache by <a href="http://mnm.uib.es/gallir/">Ricardo Galli Granada</a>.
6
- Version: 0.8.3
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */
@@ -626,13 +626,16 @@ function wp_cache_edit_max_time () {
626
  echo '<form name="wp_edit_max_time" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
627
  echo '<label for="wp_max_time">Expire time:</label> ';
628
  echo "<input type=\"text\" size=6 name=\"wp_max_time\" value=\"$cache_max_time\" /> seconds<br />";
629
- if( !isset( $wp_cache_gc ) )
630
- $wp_cache_gc = 1000;
631
- echo "<h4>Garbage Collection</h4><p>How often should expired files be deleted? Once every:</p>";
632
- echo "<ul><li><input type='radio' name='wp_cache_gc' value='1000'" . ( $wp_cache_gc == 1000 ? ' checked=checked' : '' ) . " /> 1000 requests</li>\n";
633
- echo "<li><input type='radio' name='wp_cache_gc' value='2000'" . ( $wp_cache_gc == 2000 ? ' checked=checked' : '' ) . " /> 2000 requests</li>\n";
634
- echo "<li><input type='radio' name='wp_cache_gc' value='5000'" . ( $wp_cache_gc == 5000 ? ' checked=checked' : '' ) . " /> 5000 requests</li></ul>\n";
635
- echo "<p>Checking for and deleting expired files is expensive, but it's expensive leaving them there too. On a very busy site you can leave this fairly high. Experiment with different values and visit this page to see how many expired files remain at different times during the day.</p><p>Simple rule of thumb: divide your number of daily page views by 5 and pick the closest number above.</p>";
 
 
 
636
  echo '<div><input type="submit" ' . SUBMITDISABLED . 'value="Change expiration &raquo;" /></div>';
637
  wp_nonce_field('wp-cache');
638
  echo "</form>\n";
3
  Plugin Name: WP Super Cache
4
  Plugin URI: http://ocaoimh.ie/wp-super-cache/
5
  Description: Very fast caching module for WordPress. Once activated, you must <a href="options-general.php?page=wpsupercache">enable the cache</a>. Based on WP-Cache by <a href="http://mnm.uib.es/gallir/">Ricardo Galli Granada</a>.
6
+ Version: 0.8.4
7
  Author: Donncha O Caoimh
8
  Author URI: http://ocaoimh.ie/
9
  */
626
  echo '<form name="wp_edit_max_time" action="'. $_SERVER["REQUEST_URI"] . '" method="post">';
627
  echo '<label for="wp_max_time">Expire time:</label> ';
628
  echo "<input type=\"text\" size=6 name=\"wp_max_time\" value=\"$cache_max_time\" /> seconds<br />";
629
+ if( !isset( $wp_cache_gc ) ) {
630
+ $wp_cache_gc = 3600;
631
+ } elseif( $wp_cache_gc != '3600' && $wp_cache_gc != '21600' && $wp_cache_gc != '86400' ) {
632
+ $wp_cache_gc = '3600';
633
+ }
634
+ echo "<h4>Garbage Collection</h4><p>How often should expired files be deleted?</p>";
635
+ echo "<ul><li><input type='radio' name='wp_cache_gc' value='3600'" . ( $wp_cache_gc == 3600 ? ' checked=checked' : '' ) . " /> Once every hour.</li>\n";
636
+ echo "<li><input type='radio' name='wp_cache_gc' value='21600'" . ( $wp_cache_gc == 21600 ? ' checked=checked' : '' ) . " /> Once every 6 hours. </li>\n";
637
+ echo "<li><input type='radio' name='wp_cache_gc' value='86400'" . ( $wp_cache_gc == 86400 ? ' checked=checked' : '' ) . " /> Once every 24 hours.</li></ul>\n";
638
+ echo "<p>Checking for and deleting expired files is expensive, but it's expensive leaving them there too. On a very busy site you can leave this fairly high. Experiment with different values and visit this page to see how many expired files remain at different times during the day.</p>";
639
  echo '<div><input type="submit" ' . SUBMITDISABLED . 'value="Change expiration &raquo;" /></div>';
640
  wp_nonce_field('wp-cache');
641
  echo "</form>\n";