Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/django/utils/__pycache__/ |
Upload File : |
o �a�? � @ sF d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z mZ ddlm Z mZmZmZ ddlmZ dd lmZ dd lmZ ddlmZ ed�Zd d� Zdd� Zdd� Zdd� Zd6dd�Zd7dd�Zdd� Z dd� Z!dd� Z"dd � Z#d6d!d"�Z$d#d$� Z%d%d&� Z&d'd(� Z'd)d*� Z(d+d,� Z)d-d.� Z*d8d0d1�Z+d7d2d3�Z,d4d5� Z-dS )9a� This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: https://tools.ietf.org/html/rfc7231#section-7.1.4 Essentially, the "Vary" HTTP header defines which headers a cache should take into account when building its cache key. Requests with the same path but different header content for headers named in "Vary" need to get different cache keys to prevent delivery of wrong content. An example: i18n middleware would need to distinguish caches by the "Accept-language" header. � N)�defaultdict)�settings)�caches)�HttpResponse�HttpResponseNotModified)� http_date�parse_etags�parse_http_date_safe� quote_etag)�log_response)�_lazy_re_compile)�get_current_timezone_name)�get_languagez\s*,\s*c sl dd� }dd� � t t�}| �d�r2t�| jd �D ]}||�\�}�dkr-|� �|� q||�<