WebPagetest Forums

Full Version: First Byte Time and Specify a cache validator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hello friends Big Grin

I want to reduce First Byte Time but do not know how I can do Sad

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?
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.
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)?
thanks friends will consider the recommendations

in this case is vbulletin

how to resolve the issue?

"Specify a Last-Modified or ETag"
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.
this link ?

http://www.webpagetest.org/result/111017...pagespeed/

Specify a cache validator

thx Wink
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.
thx pmeenan !!! follow your tips

units are adsense ads would inevitably have to be some way to load only 1 time Sad

"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?
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.
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>
Pages: 1 2
Reference URL's