Skip to content

Instantly share code, notes, and snippets.

@Pchelolo
Created July 27, 2015 16:25
Show Gist options
  • Save Pchelolo/347211b4b04a486518a5 to your computer and use it in GitHub Desktop.
Save Pchelolo/347211b4b04a486518a5 to your computer and use it in GitHub Desktop.
on_request:
- get_cached:
method: get # can be omitted, get is default
# Support cache-control refreshs;
# key_value bucket returns 404 when receiving no-cache header
headers:
cache-control: '{cache-control}'
uri: /{domain}/sys/key_value/postservice.png/{hash}
- return_on_success!: '{$.get_cached}'
- get_post:
# If png not found, load original post request
uri: /{domain}/sys/post_data/postservice/{hash}
- new_png:
method: post
uri: http://some.post.service/png
body: '{$.get_post.body}'
- save_new_png:
method: put
uri: /{domain}/sys/key_value/postservice.png
headers: '{$.new_png.headers}'
body: '{$.new_png.body}'
- return!: '{$.new_png}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment