
    ^(j                         U d Z ddlmZ ddlmZmZ dZeed<   dZ	eed<   dZ
ej                  d	ej                  d
eej                  geej                     f   dej                  fd       Zy)z+Cache control middleware for ComfyUI server    )web)Callable	Awaitablei  ONE_HOURiQ ONE_DAY)	z.jpgz.jpegz.pngz.ppmz.bmpz.pgmz.tifz.tiffz.webprequesthandlerreturnc                   K    ||        d{   }| j                   j                  dd      d   }|j                  d      xr |j                  d      }| j                   j                  d      s| j                   j                  d      s|r|j                  j                  d	d
       |S | j                   j                         j                  t              s|S |j                  dk(  r%|j                  j                  d	dt                |S |j                  dv r%|j                  j                  d	dt                |S |j                  dv r|j                  j                  d	d       |S 7 `w)zcCache control middleware that sets appropriate cache headers based on file type and response statusN/   indexz.jsonz.jsz.csszCache-Controlzno-storei  zpublic, max-age=)	                     i-  i4  )i.  i/  i3  zno-cache)pathrsplit
startswithendswithheaders
setdefaultlowerIMG_EXTENSIONSstatusr   r   )r   r	   responsepath_filenameis_entry_points        E/Users/danicosta/Desktop/Flux2/ComfyUI/middleware/cache_middleware.pycache_controlr$      sP    
 $+7#33HLL''Q/3M"--g6 =;Q;Q<N ||U#w||'<'<V'D##OZ@ <<((8 ###O7Gz5RS O 
I	I##O7Gy5QR O 
O	+##OZ@ O5 4s   E1E.E E1N)__doc__aiohttpr   typingr   r   r   int__annotations__r   r   
middlewareRequestResponser$        r#   <module>r/      s|    1  & #  
 [[#+S[[M9S\\;R,R#S\\ r.   