Fix 10-minute asset delay

This commit is contained in:
Mahad Kalam 2026-02-15 10:33:05 +00:00
parent f16c991808
commit cba729e73f
2 changed files with 6 additions and 3 deletions

View file

@ -50,9 +50,7 @@ COPY . .
# Precompile bootsnap code for faster boot times # Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile app/ lib/ RUN bundle exec bootsnap precompile app/ lib/
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY # Worker doesn't serve assets, skip asset precompilation
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails tailwindcss:build
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app image # Final stage for app image
FROM base FROM base

View file

@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base
before_action :try_rack_mini_profiler_enable before_action :try_rack_mini_profiler_enable
before_action :track_request before_action :track_request
before_action :enforce_lockout before_action :enforce_lockout
before_action :set_cache_headers
around_action :switch_time_zone, if: :current_user around_action :switch_time_zone, if: :current_user
@ -66,6 +67,10 @@ class ApplicationController < ActionController::Base
redirect_to deletion_path redirect_to deletion_path
end end
def set_cache_headers
response.headers["Cache-Control"] = "no-store"
end
def initialize_cache_counters def initialize_cache_counters
Thread.current[:cache_hits] = 0 Thread.current[:cache_hits] = 0
Thread.current[:cache_misses] = 0 Thread.current[:cache_misses] = 0