Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Aug 2008 at 11:37 UTC
Updated:
25 Jan 2015 at 16:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedIt looks like drupal_page_cache_header() already does that for the Etag part. The Content-Length might help, thou.
Comment #2
yonailo commentedCould you please elaborate how the Content-Legth field can help with performance ? if you can give some URLs it would be nice !. Thanks.
Comment #3
yonailo commentedSorry I mistakenly changed the title of the thread.
Comment #4
yonailo commentedI have found problems applying this patch on my site.
Specifically, I have found incomplete load of our home page when it is served from the cache on Internet Explorer 6, we use a lot of jquery and ajax calls on the web page, and the problem dissapears if I remove the Content-Length header and truncate cache_page.
Comment #5
dave reidRevised patch that adds the content-length to drupal_page_cache_header, instead of adding the headers really late in page_set_cache.
Comment #6
dave reidRevision to title because this patch no longer adds the etag header, since the drupal_page_cache_header function already does that. The patch in #5 also moves some header() calls around so that they can be done together.
Comment #7
yonailo commentedI am watching the patch and it seems not right to me. After adding the header Content-Lenght, there is a condition that uncompress cache->data if the browser does not support compression, that would make the value previously set invalid, wouldn't it?
Comment #8
dave reidNo, it sends that header only after $cache->data has been prepared.
Comment #9
yonailo commentedOk, I didn't apply the patch and I was looking at my source code, which is D5:
Obvisouly to apply this patch on this code, the header('Content-Length') should be set AFTER the line:
because this line modifies the length.
That was what I was saying. Sorry for the confusion.
Comment #10
lilou commentedPatch attached according to #9. Add also a comment (from http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html ) :
Comment #11
dave reidOk seriously, the patch in #5, sends that header after all the $cache->data manipulation has been done. You need to try the patch. According to the description, "The patch in #5 also moves some header() calls around so that they can be done together." (for clarity).
I'm all for the additional comment in #10, but for readability sake, let's please base off the patch in #5.
Comment #12
lilou commentedSo ...
Comment #13
lilou commentedComment #14
yonailo commentedDave Reid is absolutely right, his patch applies correctly.
Is it not possible to delete my previous post (#10) ?
I see that I can edit it, but I am a bit ashamed so I would like to remove it...
(you can consider me as a kind of drupal.org newbie :)
Comment #15
c960657 commentedNote that setting Content-Length explicitly causes problems with PHPs zlib.output_compression feature, so I suggest not adding the header if this feature is enabled:
http://www.php.net/manual/en/ref.zlib.php#43181
Could you give some examples of situations where this would improve performance?
Comment #17
dave reidFailed due to #74645: modify file_scan_directory to include a regex for the nomask.. Setting back to code needs review.
Comment #19
lilou commentedAdd tag.
Comment #20
nicholasthompsonWhat's the status of this? Is it safe to add the Content-Length header even for gzipped pages?
Comment #21
chx commented