开发者

Targeting specific files/folders for browser caching

开发者 https://www.devze.com 2023-04-05 17:32 出处:网络
Through research, I have yet to find a clear answer. I know that you can set headers to cache specific extensions such as .jpg, .png, .js, etc. But no where have I found if you can target a folder or

Through research, I have yet to find a clear answer.

I know that you can set headers to cache specific extensions such as .jpg, .png, .js, etc. But no where have I found if you can target a folder or a开发者_开发问答 specific file to cache on the client browser.

Here's our senario: we have massive sprites (up in the thousands of pixels) that hold most of the images on our site. We want to embrace the local caching on the client browser but at the same time want to specify what folders or specific files should use the browser cache (not just the overall apache headers).

Is this possible? If so, how can it best be implemented?


Would this article help?

So you'd have something like:

<Directory "/website/path/to/images">
    ....

    and within here can target extensions too

    <FilesMatch "\.(gif|jpg|png)$">
        ...
    </FilesMatch>
</Directory>
0

精彩评论

暂无评论...
验证码 换一张
取 消