{"id":29586653,"url":"https://github.com/basecamp/assets-redirect","last_synced_at":"2025-07-20T03:31:16.828Z","repository":{"id":236902170,"uuid":"788544205","full_name":"basecamp/assets-redirect","owner":"basecamp","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-08T14:57:50.000Z","size":18,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-18T05:34:42.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/basecamp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-04-18T16:11:20.000Z","updated_at":"2025-06-04T10:18:23.000Z","dependencies_parsed_at":"2024-04-29T07:12:22.552Z","dependency_job_id":null,"html_url":"https://github.com/basecamp/assets-redirect","commit_stats":null,"previous_names":["basecamp/assets-redirect"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/basecamp/assets-redirect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basecamp%2Fassets-redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basecamp%2Fassets-redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basecamp%2Fassets-redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basecamp%2Fassets-redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/basecamp","download_url":"https://codeload.github.com/basecamp/assets-redirect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basecamp%2Fassets-redirect/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266063099,"owners_count":23870716,"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","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":[],"created_at":"2025-07-20T03:30:58.198Z","updated_at":"2025-07-20T03:31:16.822Z","avatar_url":"https://github.com/basecamp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Assets::Redirect\n\nA Rack middleware for [Rails](https://github.com/rails/rails) with asset pipeline and asset digest enabled. This middleware is used to redirect any not found request to static asset to the latest version with digest in its filename by reading the  manifest file generated after you run `rake assets:precompile`\n\nFor example, if a browser is requesting this URL, and the image with the digest has been removed:\n\n    http://example.org/assets/dog-faa42cf2fd5db7e7290baa07109bc82b.png\n\nThey will get redirected to the current version pointed by the manifest:\n\n    http://example.org/assets/application-faa42cf2fd5db7e7290baa07109bc99b.png\n\nThis gem is designed to run on your staging or production environment, where you already precompile all your assets, turn on your asset digest, and turn of asset compilation. This is useful if you're having a static page or email which refers to static assets in the asset pipeline, in this case the asset with the old digest can be lost after a deploymeny, and is convenient to automatically show the current version instead of a 404.\n\nThis gem has been inspired from https://github.com/sikachu/sprockets-redirect, but with the difference that in this gem both digested/undigested links will automatically redirect to the latest digested version.\n\n## Requirements\n\n- Application running on [Ruby on Rails](http://github.com/rails/rails) version \u003e= 4.2.0.\n- [Sprockets](https://github.com/rails/sprockets) or [Propshaft](https://github.com/rails/propshaft) as assets pipeline.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add assets-redirect\n\n## Usage\n\nThis middleware will be enabled by default if you set `config.assets.compile = false` and `config.assets.digest = true` in your configuration file.\n\n### Running inside Docker with Sprockets\n\nIf you run the app in a Docker container and are using Sprockets is suggested to keep the Sprockets cache (`tmp/cache/assets`) in the container, this allows faster redirect\nlookups for `.js` and `.css` files.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/basecamp/assets-redirect.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasecamp%2Fassets-redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasecamp%2Fassets-redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasecamp%2Fassets-redirect/lists"}