Skip to content

Commit

Permalink
Hash cache keys to avoid too keys being too long. Resolves #240
Browse files Browse the repository at this point in the history
  • Loading branch information
Karel Vervaeke authored and mistercrunch committed Apr 3, 2016
1 parent 10ab678 commit ef45c20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion caravel/viz.py
Expand Up @@ -9,6 +9,7 @@
import json
import logging
import uuid
import hashlib

from flask import flash, request, Markup
from markdown import markdown
Expand Down Expand Up @@ -265,7 +266,8 @@ def json_endpoint(self):

@property
def cache_key(self):
return self.get_url(json="true", force="false")
url = self.get_url(json="true", force="false")
return hashlib.md5(url).hexdigest()

@property
def csv_endpoint(self):
Expand Down

0 comments on commit ef45c20

Please sign in to comment.