Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proxy requests so we can cache via CF
Browse files Browse the repository at this point in the history
brianjaustin committed Dec 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a77c384 commit 0662741
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -33,8 +33,9 @@
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# Store uploaded files in S3, proxied (see config/storage.yml for options).
config.active_storage.service = :s3
config.active_storage.resolve_model_to_route = :rails_storage_proxy

# Use a different cache store in production
config.cache_store = :mem_cache_store, ArchiveConfig.MEMCACHED_SERVERS,
@@ -94,7 +95,4 @@

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# Store uploaded files in AWS S3.
config.active_storage.service = :s3
end
3 changes: 2 additions & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
@@ -69,8 +69,9 @@
Bullet.counter_cache_enable = false
end

# Store uploaded files in AWS S3.
# Store uploaded files in AWS S3, proxied so we can cache them.
config.active_storage.service = :s3
config.active_storage.resolve_model_to_route = :rails_storage_proxy

config.middleware.use Rack::Attack

0 comments on commit 0662741

Please sign in to comment.