Skip to content
Browse files

Invalidation now support either array or single file. Using html as e…

…xtension
  • Loading branch information...
1 parent 04fa5e3 commit 71a535c8cc83f4e6de7da232a3ce87632b61649e @stenehall committed Jul 5, 2011
Showing with 10 additions and 6 deletions.
  1. +8 −4 extreamcache.plugin.php
  2. +2 −2 extreamcache.plugin.xml
View
12 extreamcache.plugin.php
@@ -42,7 +42,7 @@ class ExtreamCache extends Plugin
const EXPIRE_STATS = 604800;
const STATS_GROUP_NAME = 'extreamcache_stats';
const GROUP_NAME = 'extreamcache';
- const FILE_EXTENSION = 'extream';
+ const FILE_EXTENSION = 'html';
const CACHE_PATH = 'user/cache';
/**
@@ -211,6 +211,10 @@ public function cache_invalidate( $urls )
$slug = str_replace($habari, '', $slug);
$slug = str_replace(HABARI_PATH, '', $slug);
$file = HABARI_PATH.'/'.self::CACHE_PATH.$slug;
+ if ( ! strpos($file, self::FILE_EXTENSION))
+ {
+ $file .= '.'.self::FILE_EXTENSION;
+ }
unlink($file);
}
}
@@ -230,7 +234,7 @@ public function action_post_update_after( Post $post )
URL::get('atom_feed', 'index=1'),
Site::get_url('habari')
);
- $this->cache_invalidate($comment->post->slug.'.'.self::FILE_EXTENSION);
+ $this->cache_invalidate($urls);
}
@@ -249,11 +253,11 @@ public function action_comment_update_after( Comment $comment )
/**
* Setup the initial ignore list on activation. Ignores URLs matching the following:
- * /admin, /feedback, /user, /ajax, /auth_ajax, and ?nocache
+ * /auth, /admin, /feedback, /user, /ajax, /auth_ajax, /cron and ?nocache
*/
public function action_plugin_activation()
{
- Options::set('extreamcache__ignore_list', '/admin,/feedback,/user,/ajax,/auth_ajax,?nocache,/cron');
+ Options::set('extreamcache__ignore_list', '/auth,/admin,/feedback,/user,/ajax,/auth_ajax,?nocache,/cron');
}
View
4 extreamcache.plugin.xml
@@ -4,13 +4,13 @@
<license url="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Software License 2.0</license>
<author url="http://broken8.se">eighty4</author>
<version>0.2</version>
- <url>http://broken8.se/</url>
+ <url>http://broken8.se</url>
<description><![CDATA[Caches static HTML output. Heavily based on <a href="http://trac.habariproject.org/habari-extras/browser/plugins/staticcache/trunk">staticcache</a>]]></description>
<copyright>2011</copyright>
<guid>4e6ebfe4-da7d-4218-b79c-ecab7c172e8b</guid>
<help>
<value><![CDATA[
- <p>RewriteCond /Users/stenehall/Sites/home/broken8/htdocs/user/cache%{REQUEST_URI}.extream -f<br/>
+ <p>RewriteCond #CHANGE THIS TO YOUR PATH#/htdocs/user/cache%{REQUEST_URI}.extream -f<br/>
RewriteRule . user/cache%{REQUEST_URI}.extream [L]
</p>
]]></value>

0 comments on commit 71a535c

Please sign in to comment.
Something went wrong with that request. Please try again.