bagisto/bagisto-varnish

dev-master 2022-04-29 13:53 UTC

This package is auto-updated.

Last update: 2024-09-29 06:20:28 UTC


README

Varnish setup for Bagisto E-commerce.

Note: This setup is only for Bagisto E-commerce. If you want you can customize this as per your need.

Requirements

  • You need to setup the Varnish 6 in your system.

  • Copy all the contents of the vcls/6.0.vcl file to the /etc/varnish/default.vcl.

  • Restart your varnish server.

Installation

  • Run composer require bagisto/bagisto-varnish.

  • After that cacheable middleware is available for your routes. Use this cacheable middleware to the routes which you want to cache.

  • In packages/Webkul/Shop/src/Routes/store-front-routes.php, add cacheable in middleware key,

    # File: packages/Webkul/Shop/src/Routes/store-front-routes.php
    ...
    Route::group(['middleware' => ['web', 'locale', 'theme', 'currency', 'cacheable']], function () {
      ...
    });
    ...
  • In packages/Webkul/Velocity/src/Routes/front-routes.php, add cacheable in middleware key,

    # File: packages/Webkul/Velocity/src/Routes/front-routes.php
    ...
    Route::group(['middleware' => ['web', 'locale', 'theme', 'currency', 'cacheable']], function () {
      ...
    });
    ...
  • Run php artisan optimize:clear