Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何为图像、css、js 等指定浏览器缓存,但仅限于某些域?我们有自己的基本 CDN,并且希望来自子域的图像与主域上的图像分开缓存。
您应该能够将其添加到所需域/子域根目录中的 .htaccess
<FilesMatch ".(js|css|gif|jpg|jpeg|png|ico)$"> Header set Cache-Control "max-age=604800" </FilesMatch>