Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Maybe not the best caching system, but its a caching system :)
EasyCache is an in-memory cache system for Ruby designed for situations where you don't want to set up Redis or Memcached but still need a simple solution for caching key-value data in the process
memory.
gem install easycache
To use EasyCache in your Ruby project, require the library and include it in your code:
require 'easycache'
cache = EasyCache.new
key = "my_key"
cache_ttl = 3600
store_in_mem = true
data = cache.fetch(cache_key, cache_ttl, store_in_mem) do
my_http_get
end
Now data is in-mem for the next 3600 second (store_in_mem variable is important for storing data first time).
If i want to get the data stored in mem i do
data = cache.fetch("my_key")
or i can also re-call the same function
data = cache.fetch("my_key", cache_ttl, store_in_mem) do
my_http_get
end
because the data is already cached, so it will not call the block, it will return the cached data instead.
This will output the cached data, remember that cached data is stored in mem for only 3600 seconds
You can search for examples in examples
folder for caching http requests and responses using EasyCache
Bug reports and pull requests are welcome on GitHub at https://github.com/malvads/easycache .
FAQs
Unknown package
We found that easycache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.