Socket
Book a DemoInstallSign in
Socket

solid_cache_dashboard

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid_cache_dashboard

0.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Solid Cache Dashboard

A beautiful dashboard for solid_cache. Monitor your Rails application cache performance with detailed stats and visualizations.

Inspired by Solid Queue Dashboard

Features

  • Real-time monitoring of cache hits, misses, writes, and deletes
  • Visual charts to track cache performance over time
  • Detailed views of all cache entries with size information
  • Ability to inspect and delete individual cache entries
  • Dark mode support
  • Responsive design for all device sizes

Screenshots

Solid Cache Dashboard for Rails

---

Solid Cache Dashboard for Rails

Installation

Add this line to your application's Gemfile:

gem "solid_cache_dashboard"

And then execute:

$ bundle install

Run the installation generator:

$ rails generate solid_cache_dashboard:install
$ rails db:migrate

This will create a migration for the cache events table that tracks cache hits, misses, writes, and deletes.

Usage

Mount the dashboard in your config/routes.rb:

Rails.application.routes.draw do
  mount SolidCacheDashboard::Engine => "/solid-cache"

  # The rest of your routes...
end

Now you can access the dashboard at /solid-cache.

Configuration

You can configure the dashboard by creating an initializer:

# config/initializers/solid_cache_dashboard.rb
SolidCacheDashboard.configure do |config|
  config.title = "My App Cache Dashboard"
end

Authentication

For authentication, you can use routing constraints:

# config/routes.rb
Rails.application.routes.draw do
  authenticate :user, -> (user) { user.admin? } do
    mount SolidCacheDashboard::Engine => "/solid-cache"
  end
end

Or you can create a controller concern:

# app/controllers/concerns/solid_cache_dashboard/authentication.rb
module SolidCacheDashboard
  module Authentication
    extend ActiveSupport::Concern

    included do
      before_action :authenticate_solid_cache_dashboard
    end

    private

    def authenticate_solid_cache_dashboard
      if !user_signed_in? || !current_user.admin?
        redirect_to main_app.root_path, alert: "Not authorized"
      end
    end
  end
end

Then require it in an initializer:

# config/initializers/solid_cache_dashboard.rb
Rails.application.config.to_prepare do
  SolidCacheDashboard::ApplicationController.include SolidCacheDashboard::Authentication
end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/afomera/solid_cache_dashboard.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 27 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.