Current time: 12-05-2020, 10:45 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Leverage browser caching
11-19-2015, 09:39 PM
Post: #1
Leverage browser caching
How to set max-age or expires for external links. See result of my client site. Thanks

http://www.webpagetest.org/result/151119...ic_content
Find all posts by this user
Quote this message in a reply
11-20-2015, 10:27 PM
Post: #2
RE: Leverage browser caching
anyone know how to fix it...Thanks
Find all posts by this user
Quote this message in a reply
11-21-2015, 03:49 AM
Post: #3
RE: Leverage browser caching
(11-19-2015 09:39 PM)erdranreb Wrote:  How to set max-age or expires for external links. See result of my client site. Thanks

http://www.webpagetest.org/result/151119...ic_content

You cannot change that for external resources.
Find all posts by this user
Quote this message in a reply
12-11-2015, 11:11 AM
Post: #4
RE: Leverage browser caching
Hi can anyone know how to fix this, I had my latest result. How can I fix the Leverage browser caching of static assets.

http://www.webpagetest.org/result/151211...ic_content

thanks
Find all posts by this user
Quote this message in a reply
12-11-2015, 12:54 PM
Post: #5
RE: Leverage browser caching
My advice... change your focus and find out why a 4.5KB file like http://paramountinsurance.net/wp-content...jpg?c11df8 has a 2.5s TTFB.

Personally I'd throw away your solution to delivering remote files: if you can't just copy and server them locally, I'd leave them alone, or if you're really worried, decide whether you want to use the 3rdparty service that requires them.
Find all posts by this user
Quote this message in a reply
12-11-2015, 01:11 PM
Post: #6
RE: Leverage browser caching
Copy I will check thank you very much.
Find all posts by this user
Quote this message in a reply
12-13-2015, 01:20 AM
Post: #7
RE: Leverage browser caching
You'll require setting caching headers at the Apache server level or requesting your Hosting Company do this (good luck). Is speed's an issue, locate a hosting company who automatically sets all this up for all clients.

On Debian/Ubuntu do these steps...

1) Create an expires.conf file. Rarely is a default expires.conf file provided. Here's a copy off one of my servers.

net4-dev# cat /etc/apache2/mods-available/expires.conf
<IfModule mod_headers.c>

Header unset ETag
FileETag None

<FilesMatch "\\.(js|css|jpg|png|gif|jpeg|mov|mp4|mp3|eof|woff)$">
RequestHeader unset Cookie
Header unset Set-Cookie
</FilesMatch>

</IfModule>

<IfModule mod_expires.c>

#<Files ~ "\.(html|htm|php|pl|cgi|txt)$">
# Header set Content-Type text/html
# AddDefaultCharset UTF-8
#</Files>

ExpiresActive On
ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/png "access plus 3 months"
ExpiresByType image/jpg "access plus 3 months"
ExpiresByType image/gif "access plus 3 months"
ExpiresByType image/jpeg "access plus 3 months"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/mpeg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/quicktime "access plus 1 month"
ExpiresByType video/x-ms-wmv "access plus 1 month"
ExpiresByType text/css "access plus 3 months"
ExpiresByType text/html "access plus 3 months"
ExpiresByType text/javascript "access plus 3 months"
ExpiresByType application/javascript "access plus 3 months"

ExpiresByType image/svg+xml "access plus 3 months"
ExpiresByType application/font-sfnt "access plus 3 months"
ExpiresByType application/font-woff "access plus 3 months"
ExpiresByType application/application/vnd.ms-fontobject "access plus 3 months"

</IfModule>

2) Enable the expires module + restart apache.

a2enmod expires
service apache2 restart

3) Use curl to test headers...

curl -I -L http://www.marshallins.net | egrep ^Expires

Keep in mind your running WordPress on this site, so you're probably far better off using something like ZenCache to correctly set all your headers.

Do not use W3TC, unless you'd like to spend hours mucking about with it, trying to get a minor performance increase.

Like help speeding up your site? Skype me @ ID davidfavor for a quote. Be sure to include your site name in your Skype Add Contact request.
Find all posts by this user
Quote this message in a reply
12-16-2015, 05:06 AM
Post: #8
RE: Leverage browser caching
<FilesMatch "\\.(js|css|jpg|png|gif|jpeg|mov|mp4|mp3|eof|woff)$">

remove the first \

I set expires headers for a few more...
\.(ico|css|js|ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|​png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|pptx|tar|mid|midi|wav|bmp|rtf)$

Sorry for the difference in format, I primarily use nginx these days.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)