Current time: 12-19-2017, 12:46 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
only declaration of mod_deflate lost 400-600 ms on TTFB
06-24-2015, 10:03 PM
Post: #1
only declaration of mod_deflate lost 400-600 ms on TTFB
I would like to get to my site 100 score on google page speed and I only have the problem of TTFB in a few pages, a few pages in my TTFB is 400-600 ms.

Now I noticed a problem if I disable gzip compression, my site is under 200ms, and then passes the test of google page speed.

I have the problem of high TTFB with this configuration in my .htaccess:

Code:
<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript

  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css

  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>

now, if erase this , my website not have the problem of TTFB but have the problem of gzip compression .

so what is the problem?, that if I enter only the declaration of the gzip compression I have TTFB high just the same.

why the only declaration of mod_deflate increase between 400-600 ms my TTFB ? it's normal ? why if not gzip never file increase equally the time?

with only this two line of declaration have the problem:

Code:
<IfModule mod_deflate.c>

</IfModule>
Find all posts by this user
Quote this message in a reply
06-25-2015, 12:25 AM
Post: #2
RE: only declaration of mod_deflate lost 400-600 ms on TTFB
If you put a check for another module does it have the same issue? I'm wondering if it is the actual processing of the .htaccess file that is causing grief for some reason.

If you control the server, can you add the definition to the main http conf file instead of .htaccess to see if that changes things?
Visit this user's website Find all posts by this user
Quote this message in a reply
06-25-2015, 05:23 AM
Post: #3
RE: only declaration of mod_deflate lost 400-600 ms on TTFB
(06-25-2015 12:25 AM)pmeenan Wrote:  If you put a check for another module does it have the same issue? I'm wondering if it is the actual processing of the .htaccess file that is causing grief for some reason.

If you control the server, can you add the definition to the main http conf file instead of .htaccess to see if that changes things?

thanks for answer, i have test to insert the code of htacces in apache config

Code:
<Directory /path/to/mysite>
  # .htaccess content  here
</Directory>

but nothing has changed, it's a really weird problem

you have some other idea?

thanks
Find all posts by this user
Quote this message in a reply
06-25-2015, 04:20 PM
Post: #4
RE: only declaration of mod_deflate lost 400-600 ms on TTFB
Is your site HTML code dynamically generated? If so could you try to save the HTML code as static file and test it again? The delay you see might be due to output buffering. When gzip is off your site might generate enough content to flush it to user and browser might start processing it early, which results in faster TTFB times. On the other hand if gzip is on and it takes a lot of time to generate "bottom" of HTML code it may slow down initial TTFB.

Could you share a test with gzip on and off?
Find all posts by this user
Quote this message in a reply
06-25-2015, 08:46 PM (This post was last modified: 07-20-2015 08:30 PM by kablakar.)
Post: #5
RE: only declaration of mod_deflate lost 400-600 ms on TTFB
(06-25-2015 04:20 PM)datadiggers Wrote:  Is your site HTML code dynamically generated? If so could you try to save the HTML code as static file and test it again? The delay you see might be due to output buffering. When gzip is off your site might generate enough content to flush it to user and browser might start processing it early, which results in faster TTFB times. On the other hand if gzip is on and it takes a lot of time to generate "bottom" of HTML code it may slow down initial TTFB.

Could you share a test with gzip on and off?



yes code dynamic, i tested to create a static html and resolve but this is normal.


the problem is not correlated if use or not mod_deflate, but why with only declaration of deflate lost 600 ms , this is a very hard questionHuh
Find all posts by this user
Quote this message in a reply
06-26-2015, 09:05 AM
Post: #6
RE: only declaration of mod_deflate lost 400-600 ms on TTFB
While the tests don't give definite answer they are in line with what I wrote earlier (especially since TTFB of a static file is normal). Most probably the delay is caused by output buffering of content by gzip filter in Apache. Try to profile your script to see where the problem might be.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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