Closed rahulvgmail closed 6 years ago
most of my code is straight out of documentation.
only thing i changed is this
class CustomListKeyConstructor(DefaultKeyConstructor): updated_at = UpdatedAtKeyBit() all_query_params = QueryParamsKeyBit()
if i comment out " updated_at = UpdatedAtKeyBit()" values are picked form cache. if i add that, it always misses the cache.
the request format is
http://52.34.132.24/travelogue/resttripnote/?limit=5&offset=25
this is updatedAt key bit function
class UpdatedAtKeyBit(KeyBitBase): def get_data(self, **kwargs): key = 'api_updated_at_timestamp' value = cache.get(key, None) if not value: value = datetime.datetime.utcnow() cache.set(key, value=value) return force_text(value)
most of my code is straight out of documentation.
only thing i changed is this
class CustomListKeyConstructor(DefaultKeyConstructor): updated_at = UpdatedAtKeyBit() all_query_params = QueryParamsKeyBit()
if i comment out " updated_at = UpdatedAtKeyBit()" values are picked form cache. if i add that, it always misses the cache.
the request format is
http://52.34.132.24/travelogue/resttripnote/?limit=5&offset=25
this is updatedAt key bit function
class UpdatedAtKeyBit(KeyBitBase): def get_data(self, **kwargs): key = 'api_updated_at_timestamp' value = cache.get(key, None) if not value: value = datetime.datetime.utcnow() cache.set(key, value=value) return force_text(value)