Adelyn on "Best way to leverage browser caching?"

ساخت وبلاگ

Hi. I had posted this in another forum this moing, but I haven't gotten a reply so I thought it might be in the wrong place. Your help would be very much appreciated.

I'm trying to leverage browser caching, and I'm unsure about some of the details. I've decided to go with cache-control instead of expires, and max-age instead of last_modified. From what I understand, this is the best way to do it now.

I've put this in my .htaccess:

## 1 Month for most static assets ##
<FilesMatch ".(json|pdf|swf|bmp|gif|jpeg|jpg|png|svg|tiff|ico|flv|css|js|mp3|mp4|html|htm|xml|txt|)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
## END 1 month for most static assets ##

Is that the correct format? Also, does the max-age directive ensure that any changes to the site are updated in the browser?

Also, I've seen other examples of this code that include the following before the rest of the code:

<IfModule mod_headers.c>

Is that necessary?

Thank you for your help.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 204 تاريخ : دوشنبه 14 تير 1395 ساعت: 4:52