🎉 BIG NEWS 🎉  ✦  Avo 4 has officially SHIPPED  ✦  🚀 the beta is over, 4.0 is here  ✦  🛠️ build admin panels, dashboards & internal tools at light speed  ✦  ⭐ you are visitor #1,188,518  ✦  🎊 tell a friend  ✦  best viewed in Ruby on Rails  ✦  👉 click here to see what’s new  ✦ 

Back to blog

Quickly clear the Rails cache in development

Tipsy tip

By Adrian Marin

October 22, 2025 68 words 1 min read

Use this quick helping before_action to quickly bust the cache in development.

You need to add this snippet in your application_controller.rb and then append the clear_cache=1 param to any URL you visit.

# app/controllers/application_controller.rb

# Append this param to bust the cache in development 🙌
# https://localhost:3000?clear_cache=true
before_action :clear_cache_if_requested if Rails.env.development?

def clear_cache_if_requested
  Rails.cache.clear if params[:clear_cache].present?
end

Latest articles

Tags

Build your next rails app 10x faster with Avo

Avo dashboard showcasing data visualizations through area charts, scatterplot, bar chart, pie charts, custom cards, and others.

Find out how Avo can help you build admin experiences with Rails faster, easier and better.