التخزين المؤقت والطلبات الشرطية
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
avoid sending data the client already has.
الموضوعات المخطط لها
Cache-Controltells caches how long to keep a response (max-age=60) or not to (no-store).- An ETag is a version stamp for a response, for example a hash of the content.
- The client sends it back as
If-None-Match. If nothing changed, the server answers304 Not Modifiedwith no body. Last-ModifiedwithIf-Modified-Sincedoes the same using a date.- Never cache personalized or sensitive responses in shared caches: use
Cache-Control: privateorno-store.
تفاصيل المخطط المبدئي
عرض عملي
GET /products/5 -> 200, ETag: "v7", body
GET /products/5
If-None-Match: "v7" -> 304, no bodyاختبر فهمك
What does 304 save?
أظهر الإجابة
The body transfer; the client reuses its copy.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.