0

I am reading django's cache framework and came across this code (not in the docs):

feed = cache.get('sfc:index:%s' % request.LANGUAGE_CODE)

I couldnot find this style of getting/settings caches by googling. what is the purpose of : inside cache key? what does this code exactly do with those three keys e.g. sfc:index:en?

sorry for the thumb question.

doniyor
  • 36,596
  • 57
  • 175
  • 260

1 Answers1

1

Is retrieving the cached data for a feed in the request language. The key, is only a key. :)

José Ricardo Pla
  • 1,043
  • 10
  • 16
  • oh, so there is basically no difference between ``'index'`` and ``'index:bla'`` then right? – doniyor Oct 02 '14 at 09:18
  • Without seeing the code could say that. But beware if this code is using or overriding something. Django offers a Cache key transformation (https://docs.djangoproject.com/en/1.7/topics/cache/#cache-key-transformation) to combine the key prefix, key version and key to produce a final key. But this not match your 'sfc:index:%s' string. – José Ricardo Pla Oct 02 '14 at 10:00