Remove memcache dalli gem and setup code (#5057) [deploy]
This commit is contained in:
parent
eaae9c86d9
commit
90712f61c6
7 changed files with 3 additions and 33 deletions
6
Envfile
6
Envfile
|
|
@ -202,12 +202,6 @@ group :production do
|
|||
variable :SEND_LOGS_TO_TIMBER, :String # Defaults to true in production, false in development
|
||||
variable :TIMBER, :String # Only required if above is "true" or unset
|
||||
|
||||
# Memcachier
|
||||
# (https://www.memcachier.com/documentation/rails)
|
||||
variable :MEMCACHIER_SERVERS, :String
|
||||
variable :MEMCACHIER_USERNAME, :String
|
||||
variable :MEMCACHIER_PASSWORD, :String
|
||||
|
||||
# Sendgrid
|
||||
# (https://sendgrid.com/docs/API_Reference/api_v3.html)
|
||||
variable :SENDGRID_USERNAME_ACCEL, :String
|
||||
|
|
|
|||
1
Gemfile
1
Gemfile
|
|
@ -27,7 +27,6 @@ gem "carrierwave-bombshelter", "~> 0.2" # Protect your carrierwave from image bo
|
|||
gem "cld", "~> 0.8" # Compact Language Detection for Ruby
|
||||
gem "cloudinary", "~> 1.13" # Client library for easily using the Cloudinary service
|
||||
gem "counter_culture", "~> 2.2" # counter_culture provides turbo-charged counter caches that are kept up-to-date
|
||||
gem "dalli", "~> 2.7" # High performance memcached client for Ruby
|
||||
gem "delayed_job_active_record", "~> 4.1" # ActiveRecord backend for Delayed::Job
|
||||
gem "delayed_job_web", "~> 1.4" # Web interface for delayed_job
|
||||
gem "devise", "~> 4.7" # Flexible authentication solution for Rails
|
||||
|
|
|
|||
|
|
@ -212,7 +212,6 @@ GEM
|
|||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
crass (1.0.5)
|
||||
dalli (2.7.10)
|
||||
dante (0.2.0)
|
||||
datetime_picker_rails (0.0.7)
|
||||
momentjs-rails (>= 2.8.1)
|
||||
|
|
@ -883,7 +882,6 @@ DEPENDENCIES
|
|||
cld (~> 0.8)
|
||||
cloudinary (~> 1.13)
|
||||
counter_culture (~> 2.2)
|
||||
dalli (~> 2.7)
|
||||
delayed_job_active_record (~> 4.1)
|
||||
delayed_job_web (~> 1.4)
|
||||
derailed_benchmarks (~> 1.4)
|
||||
|
|
|
|||
|
|
@ -32,10 +32,6 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%# keeping this section of out the cache: if the article is never updated
|
||||
the containing cache will likely never expire and this section will be
|
||||
fixed in time until expired randomly by Memcache's algorithm, which can
|
||||
be too late for the freshness of the user experience %>
|
||||
<div>
|
||||
<% if json_data["article"]["published_at"] %>
|
||||
<small><%= time_ago_in_words json_data["article"]["published_at"] %> ago</small>
|
||||
|
|
|
|||
|
|
@ -99,19 +99,8 @@ Rails.application.configure do
|
|||
# Do not dump schema after migrations.
|
||||
config.active_record.dump_schema_after_migration = false
|
||||
|
||||
# TODO: Remove after cache store flip
|
||||
if ENV["USE_REDIS"]
|
||||
DEFAULT_EXPIRATION = 24.hours.to_i.freeze
|
||||
config.cache_store = :redis_store, ENV["REDIS_URL"], { expires_in: DEFAULT_EXPIRATION }
|
||||
else
|
||||
config.cache_store = :dalli_store,
|
||||
(ENV["MEMCACHIER_SERVERS"] || "").split(","),
|
||||
{ username: ENV["MEMCACHIER_USERNAME"],
|
||||
password: ENV["MEMCACHIER_PASSWORD"],
|
||||
failover: true,
|
||||
socket_timeout: 1.5,
|
||||
socket_failure_delay: 0.2 }
|
||||
end
|
||||
DEFAULT_EXPIRATION = 24.hours.to_i.freeze
|
||||
config.cache_store = :redis_store, ENV["REDIS_URL"], { expires_in: DEFAULT_EXPIRATION }
|
||||
|
||||
config.app_domain = ENV["APP_DOMAIN"]
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,6 @@
|
|||
#
|
||||
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||
|
||||
# NOTE: we can't enable this just yet because it likely requires a flushing on the whole cache
|
||||
# due to how the new cache keys are generated. This is intended to improve and optimize caching
|
||||
# strategies by Rails but since we use "dalli_store" we can't enable this without flushing the cache.
|
||||
# This won't be a problem when we'll have switched to "redis_cache_store"
|
||||
# see <https://blog.heroku.com/cache-invalidation-rails-5-2-dalli-store>
|
||||
# Make Active Record use stable #cache_key alongside new #cache_version method.
|
||||
# This is needed for recyclable cache keys.
|
||||
# Rails.application.config.active_record.cache_versioning = true
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ For the Dev.to tech stack we use:
|
|||
|
||||
- [_Puma_](https://github.com/puma/puma) as the web server
|
||||
- [_PostgreSQL_](https://www.postgresql.org/) as the primary database
|
||||
- [_Redis_](https://redis.io/) to store additional data and eventually replace
|
||||
memcache
|
||||
- [_Redis_](https://redis.io/) to store cached data
|
||||
- [_Fastly_](https://www.fastly.com/) for
|
||||
[edge caching](https://dev.to/ben/making-devto-insanely-fast)
|
||||
- [_Cloudinary_](https://cloudinary.com/) for image manipulation/serving
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue