FreeToGenerate.com

‏no-cache لا تعني «لا تخزّن». وسبعة من سبعة عشر تصل إلى شبكة التوصيل.

الترويسة

ماذا تقول هذه الترويسة

لا شيء هنا يخاطب ذاكرة مشتركة، وإنما تُعطى التعليمات لمتصفح الزائر وحده.

فيها no-cache، فالنسخة المخزَّنة يجب التحقق منها قبل إعادة استعمالها.

وانتبه: no-cache لا يمنع التخزين. فالاستجابة تُخزَّن فعلًا، غير أنها لا تُقدَّم من جديد دون مراجعتك أولًا. أما التوجيه الذي يمنع التخزين فهو no-store.

كل التوجيهات هنا صالحة لهذا الطرف من التبادل.

ما تعرّفه المواصفة

توجيهًا
17
تذكر ذاكرة مشتركة
7
تذكر النوعين
2
قيمتها اختيارية
3

يفرّق RFC 9111 بين الذاكرة المشتركة — شبكة توصيل محتوى أو وسيط عكسي أو أي شيء يخدم أكثر من شخص — والذاكرة الخاصة، وهي ذاكرة المتصفح. وسبعة من التوجيهات السبعة عشر تذكر الذاكرة المشتركة في تعريفها هي، واثنان فقط يذكران النوعين. أما سجلّ IANA لهذه التوجيهات فلا يحفظ من ذلك شيئًا: أسماء ومراجع ولا شيء عن السلوك، ولهذا تقرأ هذه الصفحة نصّ المواصفة نفسه.

سبعة توجيهات تأخذ قيمة، لكن أربعة منها فقط تشترطها. فـno-cache وprivate وmax-stale لكل منها صورة صحيحة بلا قيمة إطلاقًا، وفي حالة no-cache تختلف الصورتان معنى: فمع اسم ترويسة يقيّد تلك الترويسة وحدها، وبدونه يسري على الاستجابة كلها.

التوجيهات السبعة عشر

المعروض 17 / 17

التوجيهيُرسَل فيالقيمةالذاكرة المشتركةيقول RFC 9111
max-ageطلبمطلوبةلا5.2.1.1 The max-age request directive indicates that the client prefers a response whose age is less than or equal to the specified number of seconds. Unless the max-stale request directive is also present, the client does not wish to receive a stale response.
max-staleطلباختياريةلا5.2.1.2 The max-stale request directive indicates that the client will accept a response that has exceeded its freshness lifetime. If a value is present, then the client is willing to accept a response that has exceeded its freshness lifetime by no more than the specified number of seconds.
min-freshطلبمطلوبةلا5.2.1.3 The min-fresh request directive indicates that the client prefers a response whose freshness lifetime is no less than its current age plus the specified time in seconds. That is, the client wants a response that will still be fresh for at least the specified number of seconds.
no-cacheطلبلا شيءلا5.2.1.4 The no-cache request directive indicates that the client prefers a stored response not be used to satisfy the request without successful validation on the origin server.
no-storeطلبلا شيءنعم5.2.1.5 The no-store request directive indicates that a cache MUST NOT store any part of either this request or any response to it. This directive applies to both private and shared caches.
no-transformطلبلا شيءلا5.2.1.6 The no-transform request directive indicates that the client is asking for intermediaries to avoid transforming the content, as defined in Section 7.7 of [HTTP].
only-if-cachedطلبلا شيءلا5.2.1.7 The only-if-cached request directive indicates that the client only wishes to obtain a stored response. Caches that honor this request directive SHOULD, upon receiving it, respond with either a stored response consistent with the other constraints of the request or a 504 (Gateway Timeout) status code. 5.2.2.
max-ageاستجابةمطلوبةلا5.2.2.1 The max-age response directive indicates that the response is to be considered stale after its age is greater than the specified number of seconds. This directive uses the token form of the argument syntax: e.g., 'max-age=5' not 'max-age="5"'. A sender MUST NOT generate the quoted-string form.
must-revalidateاستجابةلا شيءنعم5.2.2.2 The must-revalidate response directive indicates that once the response has become stale, a cache MUST NOT reuse that response to satisfy another request until it has been successfully validated by the origin, as defined by Section 4.3.
must-understandاستجابةلا شيءلا5.2.2.3 The must-understand response directive limits caching of the response to a cache that understands and conforms to the requirements for that response's status code. A response that contains the must-understand directive SHOULD also contain the no-store directive.
no-cacheاستجابةاختياريةلا5.2.2.4 The no-cache response directive, in its unqualified form (without an argument), indicates that the response MUST NOT be used to satisfy any other request without forwarding it for validation and receiving a successful response; see Section 4.3.
no-storeاستجابةلا شيءنعم5.2.2.5 The no-store response directive indicates that a cache MUST NOT store any part of either the immediate request or the response and MUST NOT use the response to satisfy any other request. This directive applies to both private and shared caches.
no-transformاستجابةلا شيءلا5.2.2.6 The no-transform response directive indicates that an intermediary (regardless of whether it implements a cache) MUST NOT transform the content, as defined in Section 7.7 of [HTTP].
privateاستجابةاختياريةنعم5.2.2.7 The unqualified private response directive indicates that a shared cache MUST NOT store the response (i.e., the response is intended for a single user).
proxy-revalidateاستجابةلا شيءنعم5.2.2.8 The proxy-revalidate response directive indicates that once the response has become stale, a shared cache MUST NOT reuse that response to satisfy another request until it has been successfully validated by the origin, as defined by Section 4.3.
publicاستجابةلا شيءنعم5.2.2.9 The public response directive indicates that a cache MAY store the response even if it would otherwise be prohibited, subject to the constraints defined in Section 3. In other words, public explicitly marks the response as cacheable.
s-maxageاستجابةمطلوبةنعم5.2.2.10 The s-maxage response directive indicates that, for a shared cache, the maximum age specified by this directive overrides the maximum age specified by either the max-age directive or the Expires header field.

كل تعريف أدناه منقول حرفيًّا من RFC 9111 القسم 5.2 مع رقم قسمه. ولا يُرفع شيء، فالتحليل يجري في هذه الصفحة. أُخذت اللقطة في 2026-08-03

متوفر أيضًا بلغات أخرى: English · Español · Português · Français

ترويسة Cache-Control: كل التوجيهات وما تراه شبكة التوصيل

اختر التوجيهات لتحصل على ترويسة، أو الصق ترويسة لتعرف ماذا تقول فعلًا للمتصفح وللذاكرة المشتركة.

ما ترويسة Cache-Control؟

‏Cache-Control هي الطريقة التي يخبر بها الخادم الذواكرَ بما يجوز لها أن تفعله بالاستجابة، والتي يخبرها بها العميل بما سيقبله. ويعرّف RFC 9111 سبعة عشر توجيهًا لها: سبعة تُرسَل في الطلب وعشرة تُرسَل في الاستجابة. وأربعة أسماء ترد في الجهتين — max-age وno-cache وno-store وno-transform — وتعني أشياء مختلفة بحسب اتجاه سير الرسالة.

والتمييز الأهم ليس في قائمة التوجيهات أصلًا. فـRFC 9111 يفصل الذاكرة المشتركة، أي شبكة توصيل محتوى أو وسيطًا عكسيًّا أو أي شيء يخدم أكثر من شخص، عن الذاكرة الخاصة وهي ذاكرة المتصفح. وسبعة من السبعة عشر تذكر الذاكرة المشتركة في تعريفها، واثنان فقط يذكران النوعين. وتحتفظ IANA بسجلّ لهذه التوجيهات لا يحفظ من ذلك شيئًا: أسماء ومراجع ولا شيء عن السلوك، ولهذا تقرأ هذه الصفحة نصّ المواصفة.

ولذلك قد تبدو الترويسة محكمة وهي لا تقول لشبكة توصيلك شيئًا. فـmax-age يخاطب أي ذاكرة، أما s-maxage وpublic وprivate وproxy-revalidate فهي التي تقصد المشتركة صراحةً.

طريقة الاستخدام

  1. اختر الجهة. الاستجابة هي الحالة المعتادة، أي ما يرسله خادمك. والطلب ما يرسله المتصفح أو العميل، وله مجموعة أخرى من سبعة توجيهات.
  2. اضغط التوجيهات أو اكتب الترويسة مباشرةً. الأزرار وحقل النص شيء واحد: فتبديل توجيه يعيد كتابة الحقل، وتحرير الحقل يحدّث الأزرار.
  3. اقرأ الحكم لا السلسلة وحدها. يُقال لك هل يصل شيء منها إلى ذاكرة مشتركة، وما الذي يُمنَع فعلًا، وأي التوجيهات فيه مشكلة، مع نصّ المواصفة نفسه أسفل ذلك.

‏no-cache لا تعني «لا تخزّن»

هذا أثقل سوء فهم في الترويسة كلها عاقبةً، وRFC 9111 يحسمه بلا لفّ. فصورة الاستجابة من no-cache تعني أن الاستجابة «يجب ألّا تُستعمل لتلبية أي طلب آخر دون تمريرها للتحقق». فالاستجابة تُخزَّن فعلًا، غير أنها لا تُسلَّم من جديد دون مراجعة خادمك أولًا، وهو في العادة عين ما يريده الناس، ولا شيء مما يظنون أنهم يطلبونه.

أما التوجيه الذي يمنع التخزين فهو no-store: إذ «يجب ألّا تخزّن» الذاكرةُ «أي جزء» من الطلب أو الاستجابة. فإن كان عندك بيانات حساسة ولجأت إلى no-cache فقد لجأت إلى الخطأ منهما. وهذه الصفحة تذكر الاثنين نتيجتين منفصلتين بدل خلطهما، وتنبّه في حينه متى حملت الترويسة no-cache دون no-store.

وثمة دقيقة متصلة تستحق المعرفة: فـno-cache قد يأخذ اسم ترويسة قيمةً له، والصورتان مختلفتان. فبلا قيمة يسري على الاستجابة كلها، ومع اسم ترويسة يقيّد تلك وحدها ويبقى سائر الاستجابة قابلًا لإعادة الاستعمال. وسبعة توجيهات تأخذ قيمة، وأربعة منها فقط تشترطها: فـno-cache وprivate وmax-stale لكل منها صورة صحيحة تمامًا بلا شيء بعدها.

ما لن تخبرك به هذه الصفحة

لن تخبرك بما تفعله شبكة توصيلك أنت بعينها. فالتوجيهات هي ما تقول المواصفة إن على الذاكرة الموافِقة أن تفعله وما يجوز لها؛ وكل شبكة توصيل تجارية تضيف فوق ذلك إعداداتها وتوجيهاتها الخاصة وقيمها الافتراضية، وبعضها يحترم امتدادات غير قياسية لا تعرفها هذه الصفحة. فوسم التوجيه بأنه يصل إلى ذاكرة مشتركة يعني أن المعيار يخاطبها، لا أن مزوّدك ينفّذه كما تتوقّع.

وهي تغطي Cache-Control وحدها. فالطزاجة تقرّرها ترويسات أخرى كذلك — إذ يشارك فيها Expires وAge وETag وLast-Modified جميعًا — والاستجابة الخالية من Cache-Control أصلًا قد تُخزَّن بالاستدلال. ففحص ترويسة واحدة خطوة لازمة لا تدقيق كامل.

وهي تعرض ألفاظ المواصفة لا نصائح. فليس هنا ترويسة موصى بها، لأن الصحيح يتوقّف على كون المورد مخصَّصًا لشخص، وعلى كون عنوانه مرقَّم الإصدار، وعلى سرعة وصول التغيير إلى الناس. وأقصى ما تفعله الصفحة أن تتأكد أن الترويسة التي اخترتها تعني ما تظنه.

لماذا هي مجانية؟

جدول التوجيهات بضعة كيلوبايتات تسافر مع الصفحة، والتحليل يجري في متصفحك أنت. فلا يُرفع شيء مما تكتبه، ولا يُسجَّل شيء، ولا حساب عليك إنشاؤه.

بلا تسجيل، وبلا حدود، وبلا علامة مائية على أي شيء تنسخه.