{"id":19186806,"url":"https://github.com/notus-sh/dragonfly-cache","last_synced_at":"2025-08-08T04:17:53.579Z","repository":{"id":48116580,"uuid":"147816911","full_name":"notus-sh/dragonfly-cache","owner":"notus-sh","description":"A cache adapter for Dragonfly, a ruby image/assets manager (http://markevans.github.io/dragonfly/).","archived":false,"fork":false,"pushed_at":"2025-07-07T18:45:33.000Z","size":84,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-27T14:51:04.298Z","etag":null,"topics":["assets","cache","caching","dragonfly","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notus-sh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"notus-sh"}},"created_at":"2018-09-07T11:53:09.000Z","updated_at":"2025-07-07T18:45:21.000Z","dependencies_parsed_at":"2025-01-06T23:18:45.649Z","dependency_job_id":"aba90acd-8a09-4fa2-920d-365e0186d42b","html_url":"https://github.com/notus-sh/dragonfly-cache","commit_stats":{"total_commits":56,"total_committers":3,"mean_commits":"18.666666666666668","dds":0.25,"last_synced_commit":"cc61de17bbb2222434569a96c8bf62a9ae035319"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/notus-sh/dragonfly-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Fdragonfly-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Fdragonfly-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Fdragonfly-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Fdragonfly-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notus-sh","download_url":"https://codeload.github.com/notus-sh/dragonfly-cache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Fdragonfly-cache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269362264,"owners_count":24404510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets","cache","caching","dragonfly","ruby"],"created_at":"2024-11-09T11:16:47.469Z","updated_at":"2025-08-08T04:17:53.555Z","avatar_url":"https://github.com/notus-sh.png","language":"Ruby","funding_links":["https://opencollective.com/notus-sh"],"categories":[],"sub_categories":[],"readme":"# dragonfly-cache\n\n[![Unit tests](https://github.com/notus-sh/dragonfly-cache/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/notus-sh/dragonfly-cache/actions/workflows/unit-tests.yml)\n[![Gem Version](https://badge.fury.io/rb/dragonfly-cache.svg)](https://badge.fury.io/rb/dragonfly-cache)\n\n`dragonfly-cache` is a cache adapter for [Dragonfly](http://markevans.github.io/dragonfly/). It allows you to store Dragonfly's jobs results without running them again and again on each call. \n\n**For now**, `dragonfly-cache` supports only local caching of local files. It will be extended in a near future to support remote cache and file storages. \n\n## Installation\n\nAdd `dragonfly-cache` to your application's Gemfile:\n\n```ruby\ngem 'dragonfly-cache'\n```\n\nAnd then execute:\n\n```shell\nbundle install\n```\n\nOr install it yourself as:\n\n```shell\ngem install dragonfly-cache\n```\n\n## Configuration\n\nOnce installed, you should configure `dragonfly-cache` to set your application's root (`/public` by default, if the directory exists) and your cached url format (`/dragonfly-cache/:sha/:name` by default).\n\n```ruby\nDragonfly.app.configure do\n  plugin :dragonfly_cache,\n    server_root: Rails.application.root.join('public'),\n    url_format:  '/media-cache/:sha/:name'\nend\n```\n\nConfigured as this, cached files will be stored in `/public/media-cache/:sha/:name`, where `:name` is [the Dragonfly `:name` attribute of the attached file](http://markevans.github.io/dragonfly/models#name-and-extension) and `:sha` is a contraction of the job SHA params.\n\n`dragonfly-cache` will try to do its best to shorten the `:sha` part of the url and prevent cache conflicts.\n\n## How does it work?\n\n`dragonfly-cache` use a method similar to [the one described in the Dragonfly documentation to process files on-the-fly and serve them remotely](http://markevans.github.io/dragonfly/cache#processing-on-the-fly-and-serving-remotely) but use only `define_url`. \n\n## Credits\n\nThe dragonfly photography used in specs is a work from [André Karwath](https://commons.wikimedia.org/wiki/User:Aka) and is licensed under the [Creative Commons Attribution-Share Alike 2.5 Generic](https://creativecommons.org/licenses/by-sa/2.5/deed.en) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotus-sh%2Fdragonfly-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotus-sh%2Fdragonfly-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotus-sh%2Fdragonfly-cache/lists"}