About Leverage browser caching

25 views
Skip to first unread message

Lê Quang Thiện

unread,
Sep 1, 2015, 1:00:12 AM9/1/15
to pagespeed-insights-discuss
Dear friends,
I have a site hosted at nscreen.vn. All of resources(images, css, js...) hosted in another sub-domain static.nscreen.vn
I enabled static content caching for static.nscreen.vn, it seems all static resources cached already(status 304 not modified, 200 from cache, etag,... all is ok)

But when I check with page speed insights, it show
That's means it can't detect browser caching from my sub-resources domain, or anything else?
How should i fix this? Actually I don't know how it work, so many thanks for anybody who can help me
Thanks in advance

David Berry

unread,
Sep 1, 2015, 1:39:20 PM9/1/15
to pagespeed-insights-discuss
I believe this rule will be triggered for any resources that are cached for less than 30 days.  In your case, you are caching your resources, but only for 24 hours.  So what you need to do is adjust the cache period to a longer time period.  You could do 30 days, but if these resources are truly static, then you may want to consider an even longer period of time, like one year.

By caching things for 24 hours, you will improve the performance of your page within a browser session.  That is, a user comes to your site and they browse from page to page and maybe even view a few pages multiple times.  It is likely some of your resources are used on multiple pages, so there is a benefit in this case where someone is browsing around your site.

But now if that user comes back in a couple of days (> 24 hours), those resources are no longer cached, so they will have to download all of those resources again.  That is what this recommendation is telling you.  In most cases, things like images or css are unlikely to change over the period of a few days, so you can get more benefit by having a longer cache period like 30 days.

Hope this helps,
David

Lê Quang Thiện

unread,
Sep 2, 2015, 10:32:16 PM9/2/15
to pagespeed-insights-discuss
Thank David Berry,
It's ok now when I changed caching time to 30 days.

Vào 00:39:20 UTC+7 Thứ Tư, ngày 02 tháng 9 năm 2015, David Berry đã viết:
Reply all
Reply to author
Forward
0 new messages