Created
July 27, 2015 16:25
-
-
Save Pchelolo/347211b4b04a486518a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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