add new route for testing esi tag
This commit is contained in:
@@ -90,13 +90,13 @@ class ViewListener implements EventSubscriberInterface
|
||||
$response = new Response($content, $parser->getStatus() ?: 200);
|
||||
}
|
||||
|
||||
/* $response->setCache(array(
|
||||
$response->setCache(array(
|
||||
'last_modified' => new \DateTime(),
|
||||
'max_age' => 600,
|
||||
's_maxage' => 600,
|
||||
'private' => false,
|
||||
'public' => true,
|
||||
));*/
|
||||
));
|
||||
|
||||
$event->setResponse($response);
|
||||
} catch (ResourceNotFoundException $e) {
|
||||
|
||||
@@ -67,7 +67,6 @@ class Thelia extends Kernel
|
||||
if ($this->debug) {
|
||||
ini_set('display_errors', 1);
|
||||
}
|
||||
ini_set('display_errors', 1);
|
||||
$this->initPropel();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
<default key="_view">includes/addedToCart</default>
|
||||
</route>
|
||||
|
||||
<route id="esi-minicart" path="/mini-cart">
|
||||
<default key="_controller">Front\Controller\CartController::renderMiniCart</default>
|
||||
<default key="_view">includes/mini-cart</default>
|
||||
</route>
|
||||
|
||||
|
||||
<!-- Register -->
|
||||
<route id="customer.create.process" path="/register" methods="post">
|
||||
|
||||
@@ -142,4 +142,10 @@ class CartController extends BaseFrontController
|
||||
return $cartAdd;
|
||||
}
|
||||
|
||||
public function renderMiniCart()
|
||||
{
|
||||
$response = $this->render('includes/mini-cart');
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ GNU General Public License : http://www.gnu.org/licenses/
|
||||
</div>
|
||||
</li>
|
||||
{/elseloop}
|
||||
{include file="includes/mini-cart.html" nocache}
|
||||
<esi:include src="{url path="/mini-cart"}" alt="fail" ></esi:include>
|
||||
</ul>
|
||||
{/nocache}
|
||||
<ul class="nav navbar-nav navbar-categories">
|
||||
|
||||
@@ -11,7 +11,7 @@ require __DIR__ . '/../core/bootstrap.php';
|
||||
$request = Request::createFromGlobals();
|
||||
|
||||
$thelia = new Thelia("prod", false);
|
||||
//$thelia = new HttpCache($thelia);
|
||||
$thelia = new HttpCache($thelia);
|
||||
$response = $thelia->handle($request)->prepare($request)->send();
|
||||
|
||||
$thelia->terminate($request, $response);
|
||||
|
||||
@@ -44,9 +44,8 @@ if ( false === in_array($request->getClientIp(), $trustedIp)) {
|
||||
$response = Response::create('Forbidden', 403)->send();
|
||||
$thelia->terminate($request, $response);
|
||||
} else {
|
||||
$thelia = new HttpCache($thelia);
|
||||
$response = $thelia->handle($request)->send();
|
||||
//$thelia->terminate($request, $response);
|
||||
$thelia->terminate($request, $response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user