Skip to content

Commit

Permalink
Add compression to memcached values if > 1MB. Fixes #312
Browse files Browse the repository at this point in the history
  • Loading branch information
mmulich committed Apr 20, 2015
1 parent d0f6c38 commit a27343a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cnxarchive/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def search(query, query_type, nocache=False):
cache_length = int(settings['search-long-cache-expiration'])

# store in memcache
mc.set(mc_search_key, search_results, time=cache_length)
mc.set(mc_search_key, search_results, time=cache_length,
min_compress_len=1024*1024) # compress when > 1MB

# return search results
return search_results

0 comments on commit a27343a

Please sign in to comment.