Created
September 27, 2019 12:25
-
-
Save tokikanno/5cb4bdafbee7959ea40455c79a166911 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def cached_function(): | |
| result = cache.get(cache_key) | |
| if result: | |
| return result | |
| result = heavy_generate_function() | |
| cache.set(cache_key, result, expire_time) | |
| return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment