First Byte Time and Specify a cache validator

hello friends :smiley:

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

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

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" Header set Cache-Control "max-age=25920000, public" Header set Cache-Control "max-age=6048000, public" Header set Cache-Control "max-age=2160000, private" Header set Cache-Control "max-age=2160000, public, must-revalidate" Header set Cache-Control "max-age=1, private, must-revalidate" Header unset ETag FileETag None Header unset Last-Modified

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_11_1XGS5/1/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 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 :frowning:

“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

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" Header set Cache-Control "max-age=25920000, public" Header set Cache-Control "max-age=6048000, public" Header set Cache-Control "max-age=2160000, private" Header set Cache-Control "max-age=2160000, public, must-revalidate" Header set Cache-Control "max-age=1, private, must-revalidate" Header unset ETag FileETag None Header unset Last-Modified

Well, right there, your last 2 rules:

<ifModule mod_headers.c>
Header unset ETag
</ifModule>
FileETag None
<ifModule mod_headers.c>
Header unset Last-Modified
</ifModule>

You are explicitly removing the Last-Modified and ETag headers. At a minimum you should remove the last rule that removes the Last-Modified header. ETag is up to you (doesn’t really add much value but it won’t hurt in your config either).

This could also be a problem:

<filesMatch "\\.(js)$">
Header set Cache-Control "max-age=2160000, private"
</filesMatch>

It is telling intermediate proxies (like MaxCDN) to not cache the content. Change the private to public and see if it gets better.

it worked thank you very much!