Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds varnish as cache type; can enable/disable from system/cache mana…
…gement, refresh varnish cache
- Loading branch information
1 parent
36f44de
commit 13c53ae
Showing
6 changed files
with
103 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<config> | ||
<modules> | ||
<Magneto_Varnish> | ||
<active>true</active> | ||
<codePool>community</codePool> | ||
</Magneto_Varnish> | ||
</modules> | ||
</config> | ||
<?xml version="1.0"?> | ||
<config> | ||
<modules> | ||
<Magneto_Varnish> | ||
<active>true</active> | ||
<codePool>community</codePool> | ||
<depends> | ||
<Mage_Adminhtml /> | ||
</depends> | ||
</Magneto_Varnish> | ||
</modules> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
require_once('Mage/Adminhtml/controllers/CacheController.php'); | ||
|
||
class Magneto_Varnish_CacheController extends Mage_Adminhtml_CacheController { | ||
|
||
/** | ||
* Overwrites Mage_Adminhtml_CacheController massRefreshAction | ||
*/ | ||
public function massRefreshAction(){ | ||
// Handle varnish type | ||
$types = $this->getRequest()->getParam('types'); | ||
|
||
if (Mage::app()->useCache('varnish') ) { | ||
if( (is_array($types) && in_array('varnish', $types)) || $types="varnish") { | ||
Mage::helper('varnish')->purgeAll(); | ||
$this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("Varnish cache type purged .")); | ||
} | ||
} | ||
|
||
// Allow parrent handle core cache types | ||
parent::massRefreshAction(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters