description |
---|
This guide will cover all sorts of topics related to Spree application performance |
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.
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.
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).
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.
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.
Please see the configuration options detailed in Rails Guides.
Please see the configuration options detailed in Rails Guides.