Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs on cache busting #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,24 @@ require 'routemaster/drain/caching_busting'
$app = Routemaster::Drain::CachingBusting.new
```

### Bust Cache for a URL

If a service updates its `_links` one needs to clear caches to force URL
discovery. Run this (e.g. as a one-off in Hopper):

```ruby
url = ENV['MY_SERVICE_URL']
cache = Routemaster::Cache.new
cache.invalidate(url)
cache.bust(url)
```

Note that the URL has to match exactly. For example, `/` suffix would need to be busted separately.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we'd have to do both

/rider_applications/create_fountain_application

AND

rider_applications/create_fountain_application

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it means you might need https://rider-domain.deliveroo.net/ as well as https://rider-domain.deliveroo.net depending on what your code does. Unlikely though.


The links are also stored as a class variable in the running Ruby processes.
You need to restart them, too. You can restart just the affected services or
the whole app.

## HTTP Client
The Drain is using a Faraday http client for communication between services. The client
comes with a convenient caching mechanism as a default and supports custom response materialization.
Expand Down
2 changes: 1 addition & 1 deletion routemaster-drain.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.require_paths = %w(lib)

spec.add_runtime_dependency 'addressable'
spec.add_runtime_dependency 'faraday', '>= 0.9.0'
spec.add_runtime_dependency 'faraday', '>= 0.9.0', '< 1.9.0'
spec.add_runtime_dependency 'faraday_middleware'
spec.add_runtime_dependency 'typhoeus', '~> 1.1'
spec.add_runtime_dependency 'rack', '>= 1.4.5'
Expand Down