First Byte Time and Specify a cache validator
|
10-18-2011, 06:54 AM
Post: #1
|
|||
|
|||
![]()
hello friends
![]() I want to reduce First Byte Time but do not know how I can do ![]() I can not make me take MAXCDN Specify a cache validator Specify a Last-Modified or ETag http://www.webpagetest.org/result/111017_11_1XGS5/ try these lines but did not fix <ifModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType text/html "access plus 1 seconds" ExpiresByType image/gif "access plus 259200000 seconds" ExpiresByType image/jpeg "access plus 259200000 seconds" ExpiresByType image/png "access plus 259200000 seconds" ExpiresByType text/css "access plus 60480000 seconds" ExpiresByType text/javascript "access plus 21600000 seconds" ExpiresByType application/x-javascript "access plus 21600000 seconds" </ifModule> <ifModule mod_headers.c> <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> Header set Cache-Control "max-age=25920000, public" </filesMatch> <filesMatch "\\.(css)$"> Header set Cache-Control "max-age=6048000, public" </filesMatch> <filesMatch "\\.(js)$"> Header set Cache-Control "max-age=2160000, private" </filesMatch> <filesMatch "\\.(xml|txt)$"> Header set Cache-Control "max-age=2160000, public, must-revalidate" </filesMatch> <filesMatch "\\.(html|htm|php)$"> Header set Cache-Control "max-age=1, private, must-revalidate" </filesMatch> </ifModule> <ifModule mod_headers.c> Header unset ETag </ifModule> FileETag None <ifModule mod_headers.c> Header unset Last-Modified </ifModule> any suggestions? |
|||
10-18-2011, 10:15 PM
Post: #2
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
The first byte time is not going to have anything to do with cache validators (unless you want your HTML itself to be cached by the CDN - usually that is the one piece people keep dynamic).
First byte time problems are usually caused by the back-end application itself (the database queries or any external web services called) or really bad hosting and need to be tackled there. If you're running wordpress then there are some page caching plugins that can help hide the issue but REALLY fixing it requires changing the site code or moving hosting. |
|||
10-18-2011, 10:39 PM
(This post was last modified: 10-18-2011 10:44 PM by jarrod1937.)
Post: #3
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
Often times it is due almost entirely to database queries, and only because the queries are not properly optimized. Often times just recording a slow query log, going through it and identifying fields to add indexes to can help tremendously. Also it doesn't hurt to watch the actual query activity ("show processlist", for mysql), which can show you if there are locking issues causing unneeded execution delay. Rarely should you have to go into the code to change a query outright, unless it is using something really inefficient (using like '%variable%' which is bad, instead of using like 'variable%' or match against on mysql...etc). Though with the cookie cutter nature of wordpress and the like, it is hard to tell what is being called, all the more reason to do a slow query log.
Patrick, quick question, how are you determining the target first byte time reported (it's definitely not static)? |
|||
10-19-2011, 06:53 AM
(This post was last modified: 10-19-2011 07:03 AM by Sebastian.)
Post: #4
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
thanks friends will consider the recommendations
in this case is vbulletin how to resolve the issue? "Specify a Last-Modified or ETag" |
|||
10-19-2011, 07:08 AM
Post: #5
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
Do you have a link to a test that we can look at? In the grand scheme of things, it sounds like a validator is the last thing you should probably be focusing on.
|
|||
10-19-2011, 08:17 AM
Post: #6
|
|||
|
|||
RE: First Byte Time and Specify a cache validator | |||
10-19-2011, 10:54 PM
Post: #7
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
Yep, that link (well, really this one: http://www.webpagetest.org/result/111017_11_1XGS5/ but I could get there from the page speed report). The reason I asked is that it is better to optimize for the page performance itself than blindly shooting for a score of 100/100.
Looking at the waterfall itself it looks like there is a LOT of javascript loading right at the beginning of the page. I'm not sure what control vbulletin gives you over it but if you can move all of the javascript to the end of the page the page will feel a lot faster for users. Also, use <link> not @import for your css. Beyond that, it looks like you are pulling in (at least) 4 different ad units - there's not much you're going to be able to do to speed those up. |
|||
10-20-2011, 12:08 AM
Post: #8
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
thx pmeenan !!! follow your tips
units are adsense ads would inevitably have to be some way to load only 1 time ![]() "Specifying a cache validator By - a Last-Modified or ETag header - you Ensure That the validity of cached resources Efficiently Can be determined." This is done from the httpd.conf? |
|||
10-20-2011, 10:39 PM
Post: #9
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
No, it's usually done by the web server itself when it serves static files. It gets the last modified time for the file from the filesystem and responds with that. You need to make sure you don't have anything in your .htaccess that is removing it explicitly but otherwise it should just work.
MaxCDN is usually good about passing that header along so I don't think it's the CDN stripping it out. |
|||
10-21-2011, 12:14 AM
Post: #10
|
|||
|
|||
RE: First Byte Time and Specify a cache validator
all I have since
Codify compression of all HTML, PHP, JavaScript, CSS, images, and pretty much everything using deflate (turn gzip off in the vBulletin options): AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/atom_xml AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-httpd-php AddOutputFilterByType DEFLATE application/x-httpd-fastphp AddOutputFilterByType DEFLATE application/x-httpd-eruby Codify a genuine cache of files for your members <ifModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType text/html "access plus 1 seconds" ExpiresByType image/gif "access plus 259200000 seconds" ExpiresByType image/jpeg "access plus 259200000 seconds" ExpiresByType image/png "access plus 259200000 seconds" ExpiresByType text/css "access plus 60480000 seconds" ExpiresByType text/javascript "access plus 21600000 seconds" ExpiresByType application/x-javascript "access plus 21600000 seconds" </ifModule> <ifModule mod_headers.c> <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> Header set Cache-Control "max-age=25920000, public" </filesMatch> <filesMatch "\\.(css)$"> Header set Cache-Control "max-age=6048000, public" </filesMatch> <filesMatch "\\.(js)$"> Header set Cache-Control "max-age=2160000, private" </filesMatch> <filesMatch "\\.(xml|txt)$"> Header set Cache-Control "max-age=2160000, public, must-revalidate" </filesMatch> <filesMatch "\\.(html|htm|php)$"> Header set Cache-Control "max-age=1, private, must-revalidate" </filesMatch> </ifModule> <ifModule mod_headers.c> Header unset ETag </ifModule> FileETag None <ifModule mod_headers.c> Header unset Last-Modified </ifModule> |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)