Introduction
This section sets Bagisto up for production: its caches, search, and what changes on more than one server or a long-running PHP server. The pages under Digging Deeper explain how each mechanism works. The guides here configure it, each in the same order: when you need it, the setup steps, how to test it, and what to watch.
What Bagisto Does Out of the Box
| Layer | Shipped default | Guide |
|---|---|---|
| Full page cache | On, for guest storefront pages, stored in the file cache store | Configure Full Page Cache |
| Application and repository cache | The database store; six core repositories cache their reads | Cache Strategy |
| Catalog API cache | Guest product and category API responses, for an hour | Cache Strategy |
| Product search | The database | Configure Elasticsearch |
| Queue | sync in .env.example: jobs run inside the request | Queues, Jobs and Scheduling |
| Media | The local public disk | File Storage |
| Resized images | Resized on every request, sent with a 30-day Cache-Control header | Cache Strategy |
Tuning Checklist
- Move the queue off
syncso mail, index updates and imports leave the request. - Put the caches and sessions on Redis when the database is under load, and give the full page cache a store of its own.
- Use Elasticsearch when database search is too slow for the catalog, and give each environment its own index prefix.
- Serve media from Amazon S3 or Cloudflare R2, and put a CDN or reverse proxy in front of
/cache/so resized images aren't generated for every visitor.
Workers, the scheduler and framework caches are part of every deployment; see Deployment.
Pages in This Section
- Configure Elasticsearch: connecting a cluster, building the product index, and troubleshooting the connection.
- Configure Full Page Cache: the switch and lifetime, a store of its own, checking for cache hits, and clearing.
- Configure Varnish: the separate
bagisto/bagisto-varnishpackage, which replaces the built-in page cache; read its warning about signed-in pages first. - Configure Laravel Octane: running Bagisto on FrankenPHP, RoadRunner or Swoole, and the state that outlives a request.
- Configure Load Balancing: what several web servers must share, deploying to them, and an example on AWS.
Test each change on a staging copy of the store with production-like data before rolling it out. Don't use a web server page cache such as Nginx's FastCGI cache; Configure Full Page Cache explains why.
