Skip to content

Commit

Permalink
move the HTTPPurgePlugin to frontend and adminhtml instead from globa…
Browse files Browse the repository at this point in the history
…l. global will intercept static.php 404 process, cause exception.
  • Loading branch information
litespeedtech committed Jan 23, 2017
1 parent c31e357 commit d1fcea2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Model/App/FrontController/LitemagePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function aroundDispatch(
\Magento\Framework\App\RequestInterface $request
) {
$response = $proceed($request);
$this->litemageCache->debugLog('process dispatch action =' . $request->getActionName());
$this->litemageCache->debugLog('process dispatch action=' . $request->getActionName());
if ($this->litemageCache->moduleEnabled() && $response instanceof ResponseHttp) {
$this->version->process();
}
Expand Down
5 changes: 5 additions & 0 deletions Model/CacheControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public function debugEnabled()
{
return $this->_debug;
}

public function needPurge()
{
return ($this->_moduleEnabled && !empty($this->_purgeTags));
}

/**
* Add purgeable tags
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"magento/framework": "100.0.*|100.1.*|100.2.*"
},
"type": "magento2-module",
"version": "2.0.3",
"version": "2.0.4",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
3 changes: 3 additions & 0 deletions etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@
<type name="Magento\PageCache\Model\System\Config\Source\Application">
<plugin name="pagecache-system-source-litemage" type="Litespeed\Litemage\Model\System\Config\Source\ApplicationPlugin" sortOrder="1"/>
</type>
<type name="\Magento\Framework\App\Response\Http">
<plugin name="response-http-litemage-purge" type="\Litespeed\Litemage\Model\App\Response\HttpPurgePlugin" sortOrder="10"/>
</type>
</config>
30 changes: 0 additions & 30 deletions etc/di.xml

This file was deleted.

3 changes: 2 additions & 1 deletion etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<plugin name="view-layout-litemage" type="\Litespeed\Litemage\Model\Layout\LayoutPlugin"/>
</type>
<type name="\Magento\Framework\App\Response\Http">
<plugin name="response-http-litemage" type="\Litespeed\Litemage\Model\App\Response\HttpPlugin" sortOrder="10"/>
<plugin name="response-http-litemage-purge" type="\Litespeed\Litemage\Model\App\Response\HttpPurgePlugin" sortOrder="10"/>
<plugin name="response-http-litemage" type="\Litespeed\Litemage\Model\App\Response\HttpPlugin" sortOrder="20"/>
</type>
</config>
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Litespeed_Litemage" setup_version="2.0.3">
<module name="Litespeed_Litemage" setup_version="2.0.4">
<sequence>
<module name="Magento_PageCache"/>
</sequence>
Expand Down

0 comments on commit d1fcea2

Please sign in to comment.