barryvdh / laravel-httpcache

Laravel HTTP Cache
483 stars 41 forks source link

Session Issue #32

Open Chirag-Prajapati opened 7 years ago

Chirag-Prajapati commented 7 years ago

Hello @barryvdh I implemented the HTTP cache in Laravel and it is working fine. But I am getting the session issue so I took the reference of this PR https://github.com/barryvdh/laravel-httpcache/issues/31

Before implemented the code: protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \Barryvdh\HttpCache\Middleware\CacheRequests::class, \Barryvdh\HttpCache\Middleware\ParseEsi::class, ]; Took reference after implemented the below code: protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, ]; And add some code in route.php like this: Route::get('partial/cart-qty','Cart\Controllers\CartController@getItemCount')->middleware(['\Barryvdh\HttpCache\Middleware\CacheRequests::class','\Barryvdh\HttpCache\Middleware\ParseEsi::class']); I have using this route for the ESI:

So can you help me for the little issue ? Thanks

Chirag-Prajapati commented 7 years ago

@barryvdh Can you help me?

barryvdh commented 7 years ago

What error do you get?

Chirag-Prajapati commented 7 years ago

I have implemented the below code in route.But my dynamic data do not update which is use by ESI tag. Route::get('partial/cart-qty','Cart\Controllers\CartController@getItemCount')->middleware(['\Barryvdh\HttpCache\Middleware\CacheRequests::class','\Barryvdh\HttpCache\Middleware\ParseEsi::class']);

I have faced the session issue that's why I used this code but it is not working properly So can you help me?