[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Etag not being added to a large web page

Posted on 2010-01-04
4
Medium Priority
?
521 Views
Last Modified: 2012-05-08
I have a large text web page (458K uncompressed) that Apache2.2 should be adding an ETag to however it's not.  All other pages on the site are being given an ETag but not this one.  What do I need to do to fix this?

http://www.t1shopper.com/tools/port-scan/port-number-assignments.shtml

---== Apache config ===--
FileETag All
ExpiresActive On
ExpiresDefault "access plus 180 days"

Note: Most other pages also have the "Content-Length" header set but Apache seems to be excluding it for this page (which according to the HTTP spec is ok).
---=== Current Request & Response headers ===---
http://www.t1shopper.com/tools/port-scan/port-number-assignments.shtml

GET /tools/port-scan/port-number-assignments.shtml HTTP/1.1
Host: www.t1shopper.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.t1shopper.com/tools/port-scan/
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 200 OK
Date: Mon, 04 Jan 2010 19:40:57 GMT
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=15552000
Expires: Sat, 03 Jul 2010 19:40:57 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Keep-Alive: timeout=3, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

Open in new window

0
Comment
Question by:Geoff Millikan
  • 3
4 Comments
 

Author Comment

by:Geoff Millikan
ID: 26183010
Seems I've stumped all the experts!  :-)

Ok, I'll help you out a bit: I discovered that the ETag isn't being set on any files that have INCLUDES in them like this web page called "test.shtml" isn't being given an ETag.  I've searched and searched and there's no reason that having INCLUDE's should screw up Apache's core FileETag directive!!

---== test.shtml ==---
<html><body>
<!--#include virtual="/ssi/footer-master.shtml" -->
</body></html>

---== Apache httpd.config ==---
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

---== Background ==---
http://httpd.apache.org/docs/2.2/mod/core.html#fileetag

0
 
LVL 26

Accepted Solution

by:
arober11 earned 2000 total points
ID: 26185643
0
 

Author Comment

by:Geoff Millikan
ID: 26186071
No, didn't see that, I hope it's not true because there really needs to be some way of getting an ETag on dynamic content.

Seems like all content would want to be ETag'ed - especially dynamic content since it's the most expensive to serve and usually the largest to deliver. I've been reading though the Apache user group and there's a lot of people that want to add ETag to dynamically generated pages.  
http://httpd.markmail.org/search/?q=etag

I'm so surprised that the Apache documentation doesn't indicate any such ETag limitations and it appears as though it's not supported.

Enough ranting.
0
 

Author Comment

by:Geoff Millikan
ID: 26192280
FYI - Apache docs have been updated as a result of this thread, "Server Side Includes: An ETag is not generated for responses parsed by mod_include, since the response entity can change without a change of the INode, MTime, or Size of the static file with embedded SSI directives."

http://httpd.apache.org/docs/2.2/mod/core.html#fileetag

http://httpd.markmail.org/search/?q=etag#query:etag+page:1+mid:5h57rxv7nzxrnnua+state:results
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses
Course of the Month20 days, left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question