+
    Tj%"                         R t ^ RIt^ RIHt ^ RIHtHt ^ RIHtH	t	H
t
HtHt ^ RIHt ^ RIHt  ! R R]4      t ! R	 R
]4      t ! R R]]4      tR# )a  
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::

    MIDDLEWARE = [
        'django.middleware.cache.UpdateCacheMiddleware',
        ...
        'django.middleware.cache.FetchFromCacheMiddleware'
    ]

This is counterintuitive, but correct: ``UpdateCacheMiddleware`` needs to run
last during the response phase, which processes middleware bottom-up;
``FetchFromCacheMiddleware`` needs to run last during the request phase, which
processes middleware top-down.

The single-class ``CacheMiddleware`` can be used for some simple sites.
However, if any other piece of middleware needs to affect the cache key, you'll
need to use the two-part ``UpdateCacheMiddleware`` and
``FetchFromCacheMiddleware``. This'll most often happen when you're using
Django's ``LocaleMiddleware``.

More details about how the caching works:

* Only GET or HEAD-requests with status code 200 are cached.

* The number of seconds each page is stored for is set by the "max-age" section
  of the response's "Cache-Control" header, falling back to the
  CACHE_MIDDLEWARE_SECONDS setting if the section was not found.

* This middleware expects that a HEAD request is answered with the same
  response headers exactly like the corresponding GET request.

* When a hit occurs, a shallow copy of the original response object is returned
  from process_request.

* Pages will be cached based on the contents of the request headers listed in
  the response's "Vary" header.

* This middleware also sets ETag, Last-Modified, Expires and Cache-Control
  headers on the response object.

N)settings)DEFAULT_CACHE_ALIAScaches)get_cache_keyget_max_agehas_vary_headerlearn_cache_keypatch_response_headers)MiddlewareMixin)parse_http_date_safec                   R   a a ] tR t^=t oRtV 3R lt]R 4       tR tR t	Rt
VtV ;t# )UpdateCacheMiddlewarea  
Response-phase cache middleware that updates the cache if the response is
cacheable.

Must be used as part of the two-part update/fetch cache middleware.
UpdateCacheMiddleware must be the first piece of middleware in MIDDLEWARE
so that it'll get called last during the response phase.
c                   < \         SV `  V4       \        P                  V n        R V n        \        P                  V n        \        P                  V n	        R # N)
super__init__r   CACHE_MIDDLEWARE_SECONDScache_timeoutpage_timeoutCACHE_MIDDLEWARE_KEY_PREFIX
key_prefixCACHE_MIDDLEWARE_ALIAScache_aliasselfget_response	__class__s   &&L/var/www/idalgo/venv/lib/python3.14/site-packages/django/middleware/cache.pyr   UpdateCacheMiddleware.__init__G   sA    &%>> ">>#::    c                0    \         V P                  ,          # r   r   r   r   s   &r   cacheUpdateCacheMiddleware.cacheN       d&&''r   c                B    \        VR 4      ;'       d    VP                  # )_cache_update_cache)hasattrr'   )r   requestresponses   &&&r   _should_update_cache*UpdateCacheMiddleware._should_update_cacheR   s    w 56VV7;V;VVr   c                b  a aaa S P                  W4      '       g   V# VP                  '       g   VP                  R	9  d   V# VP                  '       g'   VP                  '       d   \        VR4      '       d   V# VP                  RR
4      o\        ;QJ d    V3R lR 4       F  '       g   K   RM	  RM! V3R lR 4       4      '       d   V# S P                  oSf&   \        V4      oSf   S P                  oM	S^ 8X  d   V# \        VS4       S'       d   VP                  ^8X  d   \        WSS P                  S P                  R7      o\        VR4      '       d5   \!        VP"                  4      '       d   VP%                  VV V3R l4       V# S P                  P'                  SVS4       V# )zSet the cache, if needed.CookiezCache-Controlc              3   .   <"   T F
  pVS9   x  K  	  R # 5ir    ).0	directivecache_controls   & r   	<genexpr>9UpdateCacheMiddleware.process_response.<locals>.<genexpr>j   s!      
	 &s   TFr#   renderc                 >   < SP                   P                  SV S4      # r   )r#   set)r	cache_keyr   timeouts   &r   <lambda>8UpdateCacheMiddleware.process_response.<locals>.<lambda>   s    djjnnY7Cr   )   i0  r0   )privatezno-cachezno-store)r+   	streamingstatus_codeCOOKIEScookiesr   getanyr   r   r   r	   r   r   r#   r(   callabler7   add_post_render_callbackr9   )r   r)   r*   r3   r;   r<   s   f&&@@@r   process_response&UpdateCacheMiddleware.process_responseU   sk   ((;;O!5!5Z!GO
    (33O !_b93 

333 

 
 
 O ##? "(+G,,Ax1x++s2'7DOO4::I x**x/H/H11C
  

y(G<r   r   r   r   r   )__name__
__module____qualname____firstlineno____doc__r   propertyr#   r+   rI   __static_attributes____classdictcell____classcell__r   __classdict__s   @@r   r   r   =   s3     ; ( (W6 6r   r   c                   L   a a ] tR t^t oRtV 3R lt]R 4       tR tRt	Vt
V ;t# )FetchFromCacheMiddlewarea  
Request-phase cache middleware that fetches a page from the cache.

Must be used as part of the two-part update/fetch cache middleware.
FetchFromCacheMiddleware must be the last piece of middleware in MIDDLEWARE
so that it'll get called last during the request phase.
c                z   < \         SV `  V4       \        P                  V n        \        P
                  V n        R # r   )r   r   r   r   r   r   r   r   s   &&r   r   !FetchFromCacheMiddleware.__init__   s+    &">>#::r   c                0    \         V P                  ,          # r   r!   r"   s   &r   r#   FetchFromCacheMiddleware.cache   r%   r   c                \   VP                   R	9  d
   RVn        R# \        WP                  RV P                  R7      pVf
   RVn        R# V P                  P                  V4      pVfO   VP                   R8X  d>   \        WP                  RV P                  R7      pV P                  P                  V4      pVf
   RVn        R# \        V4      ;peS   \        VR,          4      ;p e<   \        \        P                  ! 4       4      pWV,
          p\        ^ WG,
          4      VR&   RVn        V# )
zV
Check whether the page is already cached and return the cached
version if available.
GETHEADFNr6   TExpiresAge)r^   r_   )methodr'   r   r   r#   rE   r   r   inttimemax)r   r)   r;   r*   max_age_secondsexpires_timestampnow_timestampremaining_secondss   &&      r   process_request(FetchFromCacheMiddleware.process_request   s   
 >>0*/G' "'??ET	*.G'::>>), & 8%&

I zz~~i0H*.G'  +844OA!5hy6I!JJG  		,M 1 A!!_%HIHUO ',#r   )r   r   )rL   rM   rN   rO   rP   r   rQ   r#   rj   rR   rS   rT   rU   s   @@r   rX   rX      s-     ;
 ( (& &r   rX   c                   :   a a ] tR t^t oRtRV 3R lltRtVtV ;t# )CacheMiddlewarez
Cache middleware that provides basic behavior for many simple sites.

Also used as the hook point for the cache decorator, which is generated
using the decorator-from-middleware utility.
c                   < \         SV `  V4        VR ,          pVf   RpWPn         VR,          pVf   \        pW`n        Ve   W n        W0n        R#   \         d     L9i ; i  \         d     L0i ; i)r   N r   )r   r   r   KeyErrorr   r   r   r   )r   r   r   r   kwargsr   r   r   s   &&&&,  r   r   CacheMiddleware.__init__   s    &	-J!
(O	 /K"1* $!.(  		  		s"   A A$ A! A!$A21A2rK   )NN)	rL   rM   rN   rO   rP   r   rR   rS   rT   rU   s   @@r   rm   rm      s     ) )r   rm   )rP   rd   django.confr   django.core.cacher   r   django.utils.cacher   r   r   r   r	   django.utils.deprecationr
   django.utils.httpr   r   rX   rm   r0   r   r   <module>rx      sT   +Z    9  5 2NO Nb8 8v )+-E  )r   