Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

middleman-cache-do

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

middleman-cache-do

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Middleman Cache Do

Cache blocks of stuff into a memcache store. Handy for when you're making API calls between lots of builds.

Example Usage

Gemfile

gem 'dalli' # Your memcache client.
gem 'middleman-cache-do'

Install memcache locally

brew install memcache

### .env

MEMCACHEDCLOUD_SERVERS="127.0.0.1:11211"
MEMCACHEDCLOUD_USERNAME=""
MEMCACHEDCLOUD_PASSWORD=""

config.rb

activate :middleman_cache_do do |config|
  config.client = Dalli::Client.new(ENV['MEMCACHEDCLOUD_SERVERS'].split(','), {
    username: ENV['MEMCACHEDCLOUD_USERNAME'],
    password: ENV['MEMCACHEDCLOUD_PASSWORD'],
    namespace: 'middleman_cache_do',
    compress: true
  }) if ENV['MEMCACHEDCLOUD_SERVERS']
end

In your Helpers

helpers do
  def some_cached_method
    app.cache 'some_method' do
      { json: :blob } # Call your external API here.
    end
  end
end

In your views

<%= cache 'Some-Key' do %>
  <!-- Some external call to an API -->
<% end %>

FAQs

Package last updated on 23 Sep 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc