Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Latest commit

 

History

History
58 lines (34 loc) · 2.23 KB

performance.md

File metadata and controls

58 lines (34 loc) · 2.23 KB
description
This guide will cover all sorts of topics related to Spree application performance

Performance

Application

API

OJ gem

We strongly recommend adding OJ gem to your application.

If you're using Spree Starter this gem is already pre-installed and pre-configured. If you're not using Spree Starter you can easily add it yourself - please see this git commit.

Caching configuration

There are several configuration options you can put in config/initializers/spree.rb to adjust API caching configuration:

Spree::Api::Config[:api_v2_cache_ttl] = 3600 # TTL for cached resources in seconds

This is the time when API objects will be available in cache storage. Objects such as Products also auto-expire when they are updated or one of their associated resources (eg. Variants) are updated also.

Background jobs

Sending emails, parsing big amounts of data - it's not recommended to do it in the web process.

We recommend setting up ActiveJob adapter such as Solid Queue or Sidekiq. Spree Starter users don't need to do anything as it's already pre-configured for them (with Solid Queue).

Testing locally

To enable caching in the development environment please type in your project directory:

bin/rails dev cache

After that, you will need to restart your webserver / or stop/start docker-compose.

Infrastructure

Cache storage engine

We recommend using a distributed cache storage engine such as Solid Cache, Memcached or Redis. Spree Starter uses Solid Cache by default as it doesn't require any additional setup or services to be installed.

Memcached

Please see the configuration options detailed in Rails Guides.

Redis

Please see the configuration options detailed in Rails Guides.