def parse_cachecontrol(header):
 directives = {}
 for directive in header.split(','):
  (key, sep, val) = directive.strip().partition('=')
  if key:
   directives[key.lower()] = (val if sep else None)
 return directives

def parse_cachecontrol ( header ) : directives = { } for directive in header . split ( ',' ) : ( key , sep , val ) = directive . strip ( ) . partition ( '=' ) if key : directives [ key . lower ( ) ] = ( val if sep else None ) return directives
parse cache-control header URL#sec14 .