لماذا ومتى نخزّن مؤقتًا
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
know the layers where a cache can sit and what each one saves.
الموضوعات المخطط لها
- A cache keeps a copy of an expensive result close to the caller. It trades freshness for speed and load.
- Layers: browser/client (no request at all), CDN (no trip to origin), gateway (no call to the service), application (no database call), database (buffer pool, query cache).
- The closer to the user, the more you save, and the harder invalidation becomes.
- Cache only data that is read often, changes rarely, and is costly to produce.
تفاصيل المخطط المبدئي
عرض عملي
a request path diagram: browser → CDN → gateway → Shop catalog service → Redis/Caffeine → PostgreSQL, each hop labelled with what a hit there avoids.
اختبر فهمك
Which layer saves the most work when it hits?
أظهر الإجابة
The one closest to the user, e.g. the browser: no request is made.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.