开发者

How create an Etag with an expire date

开发者 https://www.devze.com 2023-03-25 17:35 出处:网络
I\'m thinking about create an etag with an expire date. Actually I create an etag with a large number of parameters but I would like to make it with an expire date.

I'm thinking about create an etag with an expire date.

Actually I create an etag with a large number of parameters but I would like to make it with an expire date.

I have the solution to keep an information in the server side but I prefer to encode any information into.

I'm searching the better way to do that.

开发者_StackOverflow中文版
def etag_max_age(hash_code, max_age=30):
  # do something...
  return etag_with_max_age

def etag_max_age_expired(etag):
  # do some verifications
  return True or False

I'm thinking about a solution with cookie


My solution to the problem would be to add a timestamp to the end of the etag in the form of hash-timestamp. You could then parse that out when you needed it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号