
    MȂi                     f    S SK Jr  S SKJr  S SKJr  S SKJrJr  S SK	J
r
  SSS.S jrS	 rS
 rS rg)    )wraps)iscoroutinefunction)CacheMiddleware)add_never_cache_headerspatch_cache_control)#decorator_from_middleware_with_argsN)cache
key_prefixc                ,    [        [        5      " U UUS9$ )a  
Decorator for views that tries getting the page from the cache and
populates the cache if the page isn't in the cache yet.

The cache is keyed by the URL and some data from the headers.
Additionally there is the key prefix that is used to distinguish different
cache areas in a multi-site setup. You could use the
get_current_site().domain, for example, as that is unique across a Django
project.

Additionally, all headers from the response's Vary header will be taken
into account on caching -- just like the middleware does.
)page_timeoutcache_aliasr
   )r   r   )timeoutr	   r
   s      ND:\sksbv-state-backend\venv\Lib\site-packages\django/views/decorators/cache.py
cache_pager   
   s     /?     c                 B    [        U S5      (       d  [        U S35      eg )NMETAzf didn't receive an HttpRequest. If you are decorating a classmethod, be sure to use @method_decorator.)hasattr	TypeError)requestdecorator_names     r   _check_requestr      s3    7F## J J
 	
 $r   c                     ^  U 4S jnU$ )Nc                 f   >^  [        T 5      (       a  UU 4S jnOUU 4S jn[        T 5      " U5      $ )Nc                 l   >#    [        U S5        T" U /UQ70 UD6I S h  vN n[        U40 TD6  U$  N7fNcache_controlr   r   r   argskwresponsekwargsviewfuncs       r   _view_wrapper?cache_control.<locals>._cache_controller.<locals>._view_wrapper,   s?     w8!)'!?D!?B!??#H77 @s   424c                 P   > [        U S5        T" U /UQ70 UD6n[        U40 TD6  U$ r   r   r   s       r   r%   r&   4   s3    w8#G9d9b9#H77r   r   r   )r$   r%   r#   s   ` r   _cache_controller(cache_control.<locals>._cache_controller)   s)    x((   X}--r    )r#   r)   s   ` r   r   r   (   s    .& r   c                 `   ^  [        T 5      (       a  U 4S jnOU 4S jn[        T 5      " U5      $ )zL
Decorator that adds headers to a response so that it will never be cached.
c                 j   >#    [        U S5        T" U /UQ70 UD6I S h  vN n[        U5        U$  N7fNnever_cacher   r   r   r    r#   r"   	view_funcs       r   r%   "never_cache.<locals>._view_wrapperF   s:     7M2&w@@@@H#H-O As   313c                 N   > [        U S5        T" U /UQ70 UD6n[        U5        U$ r.   r0   r1   s       r   r%   r3   N   s.    7M2 :4:6:H#H-Or   r(   )r2   r%   s   ` r   r/   r/   ?   s,    
 9%%		 M**r   )	functoolsr   asgiref.syncr   django.middleware.cacher   django.utils.cacher   r   django.utils.decoratorsr   r   r   r   r/   r+   r   r   <module>r:      s/     , 3 K G "&$ *
.+r   