mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 14:27:10 +00:00
Fix 10-minute asset delay
This commit is contained in:
parent
f16c991808
commit
cba729e73f
2 changed files with 6 additions and 3 deletions
|
|
@ -50,9 +50,7 @@ COPY . .
|
|||
# Precompile bootsnap code for faster boot times
|
||||
RUN bundle exec bootsnap precompile app/ lib/
|
||||
|
||||
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
|
||||
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails tailwindcss:build
|
||||
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
|
||||
# Worker doesn't serve assets, skip asset precompilation
|
||||
|
||||
# Final stage for app image
|
||||
FROM base
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base
|
|||
before_action :try_rack_mini_profiler_enable
|
||||
before_action :track_request
|
||||
before_action :enforce_lockout
|
||||
before_action :set_cache_headers
|
||||
|
||||
around_action :switch_time_zone, if: :current_user
|
||||
|
||||
|
|
@ -66,6 +67,10 @@ class ApplicationController < ActionController::Base
|
|||
redirect_to deletion_path
|
||||
end
|
||||
|
||||
def set_cache_headers
|
||||
response.headers["Cache-Control"] = "no-store"
|
||||
end
|
||||
|
||||
def initialize_cache_counters
|
||||
Thread.current[:cache_hits] = 0
|
||||
Thread.current[:cache_misses] = 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue