From 476d055003adc7445bdb6606d6bae126d3a385c3 Mon Sep 17 00:00:00 2001 From: Julio Lucero Date: Tue, 28 Jul 2026 12:37:54 -0300 Subject: [PATCH 1/3] Cache static files and lengthen audit tool title tag --- app/views/layouts/application.html.erb | 2 +- config/environments/production.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 11731e2..5b0ea5a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,7 +5,7 @@ Audit Tool - Report #<%= @alpha_id %> <% else %> - Audit Tool + Free Gemfile.lock Vulnerability Scanner | FastRuby.io <% end %> diff --git a/config/environments/production.rb b/config/environments/production.rb index 0120a93..592952a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -21,6 +21,10 @@ # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.week.to_i}" + } + # Compress JavaScripts and CSS. config.assets.js_compressor = :terser # config.assets.css_compressor = :sass From 84682163ca6f7d807100dccb31d39c803f5cd1b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20V=C3=A1squez?= Date: Tue, 28 Jul 2026 14:24:32 -0600 Subject: [PATCH 2/3] Move page titles and descriptions to content_for The layout picked titles by controller_name, so every non-gemfiles page, including /home/privacy, got the homepage title and description. Each view now declares its own, with the homepage values as the layout fallback. --- app/views/gemfiles/show.html.erb | 3 +++ app/views/home/privacy.html.erb | 3 +++ app/views/layouts/application.html.erb | 9 ++------- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/gemfiles/show.html.erb b/app/views/gemfiles/show.html.erb index 0e00327..9b830fd 100644 --- a/app/views/gemfiles/show.html.erb +++ b/app/views/gemfiles/show.html.erb @@ -1,3 +1,6 @@ +<% content_for :title, "Audit Tool - Report ##{@alpha_id}" %> +<% content_for :description, "Report ##{@alpha_id} - #{@vulnerabilities_count} Vulnerabilities found on your file" %> + <% content_for :script do %>