- 授权协议: Apache
- 开发语言: Ruby
- 操作系统: 跨平台
- 软件首页: https://github.com/plataformatec/faraday-http-cache
- 软件文档: https://github.com/plataformatec/faraday-http-cache
软件介绍
Faraday Http Cache 是一个 Faraday 的扩展,实现了 HTTP 的缓存。通过检查过期时间来验证已存储的响应信息。
使用方法:
client = Faraday.new do |builder| builder.use :http_cache, store: Rails.cache # or builder.use Faraday::HttpCache, store: Rails.cache builder.adapter Faraday.default_adapter end
使用 Memcached:
# Connect the middleware to a Memcache instance. store = ActiveSupport::Cache.lookup_store(:mem_cache_store, ['localhost:11211']) client = Faraday.new do |builder| builder.use :http_cache, store: store builder.adapter Faraday.default_adapter end # Or use the Rails.cache instance inside your Rails app. client = Faraday.new do |builder| builder.use :http_cache, store: Rails.cache builder.adapter Faraday.default_adapter end
日志:
client = Faraday.new do |builder|
builder.use :http_cache, store: Rails.cache, logger: Rails.logger
builder.adapter Faraday.default_adapter
end
client.get('http://site/api/users')
# logs "HTTP Cache: [GET users] miss, store"Web Security Testing Cookbook
Paco Hope、Ben Walther / O'Reilly Media / 2008-10-24 / USD 39.99
Among the tests you perform on web applications, security testing is perhaps the most important, yet it's often the most neglected. The recipes in the Web Security Testing Cookbook demonstrate how dev......一起来看看 《Web Security Testing Cookbook》 这本书的介绍吧!
