Skip to content

Commit

Permalink
Fix markdown formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprengere committed Mar 23, 2023
1 parent 8ebd19a commit 0f14ebe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ def view():

### Cache example

Flask-Compress can be integrated with caching mechanisms to serve compressed responses directly from the cache. This can significantly reduce server load and response times. Here is an example of how to configure Flask-Compress with caching using Flask-Caching. The example demonstrates how to create a simple cache instance with a 1-hour timeout, and use it to cache compressed responses for incoming requests.
Flask-Compress can be integrated with caching mechanisms to serve compressed responses directly from the cache. This can significantly reduce server load and response times.
Here is an example of how to configure Flask-Compress with caching using Flask-Caching.
The example demonstrates how to create a simple cache instance with a 1-hour timeout, and use it to cache compressed responses for incoming requests.

'''python
```python
# Initializing flask app
app = Flask(__name__)

cache = Cache(app, config={
'CACHE_TYPE': 'simple',
'CACHE_DEFAULT_TIMEOUT': 60*60 # 1 hour cache timeout
Expand All @@ -119,7 +122,7 @@ compress.init_app(app)
# Set up cache for compressed responses
compress.cache = cache
compress.cache_key = get_cache_key
'''
```

## Options

Expand Down

0 comments on commit 0f14ebe

Please sign in to comment.