diff --git a/app/controllers/internal/tools_controller.rb b/app/controllers/internal/tools_controller.rb index 9de1080f1..9c6b9eac2 100644 --- a/app/controllers/internal/tools_controller.rb +++ b/app/controllers/internal/tools_controller.rb @@ -29,6 +29,7 @@ class Internal::ToolsController < Internal::ApplicationController def bust_link(link) cb = CacheBuster.new + link.sub!("https://dev.to", "") if link.starts_with?("https://dev.to") cb.bust(link) cb.bust(link + "/") cb.bust(link + "?i=i") diff --git a/app/views/internal/tools/index.html.erb b/app/views/internal/tools/index.html.erb index 833161853..9af332df1 100644 --- a/app/views/internal/tools/index.html.erb +++ b/app/views/internal/tools/index.html.erb @@ -1,22 +1,23 @@ -

General Purpose Fastly Purge

-

For a page that should 404:

+

General Purpose URL Purge

+

For a page that should 404. This will purge the page via Fastly.

+

Use the full path (https://dev.to/xyz) or the relative path: (/xyz)

<%= form_tag "/internal/tools/bust_cache" do %> - <%= label_tag("Relative Link:") %> + <%= label_tag("Link:") %> <%= text_field_tag :dead_link, nil, placeholder: "/devteam/page" %> <%= submit_tag("Clear Cache") %> <% end %>

Bust Cache For Specific Content

-

This clears the rails cache & the fastly cache.

+

This clears both the Rails cache & the Fastly cache.

<%= form_tag "/internal/tools/bust_cache" do %> - <%= label_tag("Article id: ") %> + <%= label_tag("Article ID: ") %> <%= text_field_tag :bust_article, nil, placeholder: "12345" %> <%= submit_tag("Clear Cache") %> <% end %>
<%= form_tag "/internal/tools/bust_cache" do %> - <%= label_tag("User id: ") %> + <%= label_tag("User ID: ") %> <%= text_field_tag :bust_user, nil, placeholder: "12345" %> <%= submit_tag("Clear Cache") %> <% end %> diff --git a/app/views/layouts/internal.html.erb b/app/views/layouts/internal.html.erb index bdcc15814..b432f606e 100644 --- a/app/views/layouts/internal.html.erb +++ b/app/views/layouts/internal.html.erb @@ -123,7 +123,7 @@