HTTP caching browser ও CDN-কে একটি response পুনরায় fetch না করে পুনঃব্যবহার করতে দেয়, যা Cache-Control header দিয়ে নিয়ন্ত্রিত। web app-এর জন্য বিজয়ী pattern: আপনার asset filename hash করুন এবং সেগুলো চিরকাল cache করুন; HTML uncacheable রাখুন।
দুই-স্তর কৌশল
http
# Hashed, versioned assets — content never changes for a given URL
Cache-Control: public, max-age=31536000, immutable
# e.g. /static/app.9f2c1a.js (the hash changes when content changes)
# HTML — must always be fresh so it can point at new asset hashes
Cache-Control: no-cache
