Dotclear

Ticket #2147 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Very slow on /?pf=* pages if compression enabled

Reported by: RaphAstronome Owned by: team
Priority: normal Milestone: 2.9
Component: module:core Version: 2.8.2
Severity: normal Keywords:
Cc:

Description

Hi,

I have performance trouble on a OVH shared server. Files like /index.php?pf=lightbox/js/modal.js is very slow. The connexion and response is ok but after the connexion don't close and the browser wait for timeout adding huge latency to load the entire page.

After some tests I disabled the "header('Content-Length: '.filesize($PF));" line in inc/load_plugin_file.php and without any hint of length the browser closes the connexion properly.

I suppose it is due to an incompatibility between the hosting who compress the response using gzip and the length value given by Content-Length calculated with full file size and not compressed size.

The message I have sent on OVH's forum (in french) :  https://forum.ovh.com/showthread.php/107221-Lenteurs-dotclear2-pour-les-requ%C3%AAtes-pf-*

Is it possible to compute correct value or remove it if compression is detected ? (generally it is tiny files Content-Length is not so important)

Thanks

Change History

comment:1 Changed 10 years ago by franck

  • Milestone changed from A definir to 2.9

I think that we have two ways to fix this :

  1. Compute exactly the size of the transfered content (AFTER possible compression). It implies to detect if compression will be used and then which will be the method used (deflate, gzip, …). May be hard to coded, aka using ob_start("ob_gzhandler"), … And specify the correct content-length header ;
  1. Do not specify the content-length header, which I think is not mandatory (the client will wait the connection to be ended by the server).

I propose to apply the second way and test it a bit

Any comment?

comment:2 Changed 10 years ago by franck <carnet.franck.paul@…>

  • Status changed from new to closed
  • Resolution set to fixed

(In [4e0ecb714e74]) Fix #2147, content-length header is not more given

comment:3 Changed 10 years ago by RaphAstronome

Thanks for this very fast response !

comment:4 Changed 10 years ago by franck

Meanwhile you can add a directive in your .htaccess file (rather than comment the corresponding line) until we release the 2.9 version of Dotclear :

Header unset Content-Length

See:  https://httpd.apache.org/docs/2.4/mod/mod_headers.html#header

Note: See TracTickets for help on using tickets.

Sites map