MCPcopy Create free account
hub / github.com/EasyIME/PIME / get_cache_time

Method get_cache_time

python/python3/tornado/web.py:2940–2953  ·  view source on GitHub ↗

Override to customize cache control behavior. Return a positive number of seconds to make the result cacheable for that amount of time or 0 to mark resource as cacheable for an unspecified amount of time (subject to browser heuristics). By default returns ca

(
        self, path: str, modified: Optional[datetime.datetime], mime_type: str
    )

Source from the content-addressed store, hash-verified

2938 pass
2939
2940 def get_cache_time(
2941 self, path: str, modified: Optional[datetime.datetime], mime_type: str
2942 ) -> int:
2943 """Override to customize cache control behavior.
2944
2945 Return a positive number of seconds to make the result
2946 cacheable for that amount of time or 0 to mark resource as
2947 cacheable for an unspecified amount of time (subject to
2948 browser heuristics).
2949
2950 By default returns cache expiry of 10 years for resources requested
2951 with ``v`` argument.
2952 """
2953 return self.CACHE_MAX_AGE if "v" in self.request.arguments else 0
2954
2955 @classmethod
2956 def make_static_url(

Callers 1

set_headersMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected