Skip to content

Commit

Permalink
Add cachelite support
Browse files Browse the repository at this point in the history
Bypass the cache for logged members.

Fixes #284
  • Loading branch information
nitriques committed May 24, 2017
1 parent 5def939 commit 8c0ef11
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ public function getSubscribedDelegates(){
'delegate' => 'EventPostSaveFilter',
'callback' => 'processPostSaveFilter'
),
array(
'page' => '/frontend/',
'delegate' => 'CacheliteBypass',
'callback' => 'processCacheliteBypass'
),
/*
BACKEND
*/
Expand Down Expand Up @@ -1222,6 +1227,17 @@ public function processPostSaveFilter(array &$context) {
}
}

/**
* Tells the cachelite extension to bypass cache for logged in users
*
* @uses CacheliteBypass
*
* @param array $context
*/
public function processCacheliteBypass(array &$context) {
$context['bypass'] = $context['bypass'] || $this->getMemberDriver()->isLoggedIn();
}

/*-------------------------------------------------------------------------
Output:
-------------------------------------------------------------------------*/
Expand Down
3 changes: 3 additions & 0 deletions extension.meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
</author>
</authors>
<releases>
<release version="1.6.0" date="2017-05-24" min="2.4.0" max="2.x.x">
* [#284](https://github.com/symphonycms/members/issues/277) Bypassing cachelite's cache
</release>
<release version="1.5.2" date="2016-06-23" min="2.4.0" max="2.x.x">
* [#277](https://github.com/symphonycms/members/issues/277) SQL error
</release>
Expand Down

0 comments on commit 8c0ef11

Please sign in to comment.