I have a site hosted on a dedicated server (2008 R2 IIS7.5) and every so often I get a garbled web page similar to the ones below. The entire screen is filled with garbage. There seems to no pattern to the issue and it happens to others as well. I could go for hours, maybe days surfing the site without seeing it though. They are all .aspx pages on the site. Any ideas?
HTTP/1.1 200 OK Cache-Control: private Content-Type: text/html;
charset=utf-8 Content-Encoding: gzip Vary: Accept-Encoding Server:
Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET
Date: Thu, 10 Mar 2011 17:48:59 GMT Content-Length: 9874 ? ????? ??
I?%&/m?{ J?J??t? ? $?# ????? iG#)?*??eVe]f #????{???{??;?N'????\fd
l??J??!??? ?~| ?"~??7N ??O?U????`#??P??????l9??T?L?????????C?7N?????? - snip -
HTTP/1.1 200 OK Cache-Control: private Content-Type: text/html;
charset=utf-8 Content-Encoding: gzip Vary: Accept-Encoding Server:
Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET
Date: Mon, 28 Mar 2011 20:23:42 GMT Content-Length: 10601 ‹ í½
I–%&/mÊ{ JõJ×àt¡ € $Ø # ìÁˆÍæ’ì iG#)«* ÊeVe]f #Ìí ¼÷Þ{ï½÷Þ{ï½÷º;
N'÷ßÿ?\fd löÎJÚÉž!€ªÈ ?~| ?"~ãä7N ÿ®O¿^ämFãiWÛù/Z —Ÿ}tR-[j²ýæz•
”Nå¯Ï>jówí]À?L§ó¬nòö³¢©¶
î?ÜÞý(½{ô¸,–oÓ:/?û¨i¯Ë¼™çyûQ:¯óóÏ>ªó¦Z×Ó¼¹;mš»ôWÞŽé· Ò–zQàü÷"Ÿ A˜Öy¾|O
- snip-
Without inspecting the server I would not be able to tell you much, because a lot of times you would just look for idiosyncrasies or differences in configuration.
All I can say - for what is worth - is that there seems to be something to do with the GZIP (and not the encoding), considering this is a new feature in IIS. Both cases have GZIP turned on. Now it could be that you have turned the feature on but I suggest turning it off for a while to see if it happens again. This could be in fact a bug in IIS.
Related
My application uses Varnish 3.0.2. I am facing a weird problem here. Some of the times the pages are served from Varnish with a HIT. But immediately after it returns MISS.
I was under the impression that once it gets served from the cache, it will continue to do so until the TTL expires. Am I wrong in understanding that?
Here are the two response headers for both the scenario:
HIT
HTTP/1.1 200 OK
Server: Apache/2.4.16 (Unix) mod_auth_kerb/5.4 PHP/5.3.29
X-Powered-By: PHP/5.3.29
X-Drupal-Cache: MISS
Content-Language: en
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
cache-control: max-age=86400, public
X-Cookie-Debug: Request cookie:
X-Request-URL: /org/31633421?unit=31633421
Content-Length: 11986
Accept-Ranges: bytes
Date: Wed, 24 Apr 2019 14:26:43 GMT
X-Varnish: 330015711 330015651
Via: 1.1 varnish
Connection: keep-alive
X-Varnish-Cache: HIT
X-Varnish-Cache-Hits: 1
X-Varnish-Age: 188
X-Varnish-Leg: 128.87.225.172
X-Varnish-Cache-Version: 3.0.2
MISS
HTTP/1.1 200 OK
Server: Apache/2.4.16 (Unix) mod_auth_kerb/5.4 PHP/5.3.29
X-Powered-By: PHP/5.3.29
X-Drupal-Cache: MISS
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: public, max-age=300
Content-Language: en
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
X-Cookie-Debug: Request cookie: _gat_UA-15166137-36=1
X-Request-URL: /org/31633421?unit=31633421
Content-Length: 11978
Accept-Ranges: bytes
Date: Wed, 24 Apr 2019 14:23:52 GMT
X-Varnish: 1900997574
Via: 1.1 varnish
Connection: keep-alive
X-Varnish-Cache: MISS
X-Varnish-Age: 0
X-Varnish-Leg: 128.87.225.158
X-Varnish-Cache-Version: 3.0.2
I have tried to increase the TTL value, remove all the cookies (including Google Analytics) but still it's behaving abruptly.
Any idea why?
Update
Seems like this is happening for including the following Google Tag manager JS code in my view template.
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXX');</script>
Turns out it WAS actually a problem in the VCL configuration with the regex I was using. I had not considered the non-alpha characters of the Google Ananlytics cookie. Modified the regex to _[_\-\.\=a-zA-Z0-9] and everything is fun again!
Hope this helps somebody.
My guess is that it comes from two different varnish servers based on the two response headers:
X-Varnish-Leg: 128.87.225.172
and
X-Varnish-Leg: 128.87.225.158
+1 for Ronald, also please consider upgrading to the latest Varnish 6 as years have passed since Varnish 3, many bugs have been fixed and improvements built. Furthermore V3 is end of life.
I'm having a strange issue when I reload a page sequentially, sometimes it loads fine, but sometimes it loads with missing images/css, and sometimes it redirects to my site's 404 file. Below are 2 sequential curl commands which might be helpful.
For background, I've already cleared out the previous page slugs in the DB, and restored the .htaccss file. Any pointers are greatly appreciated!!
[my machine]:$ curl -s -D - [my url] -o /dev/null
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Tue, 04 Mar 2014 21:44:50 GMT
Server: Apache
X-Powered-By: PHP/5.3.14
Content-Length: 6131
Connection: keep-alive
[my machine]:$ curl -s -D - [my url] -o /dev/null
HTTP/1.1 404 Not Found
Cache-Control: no-cache, must-revalidate, max-age=0
Content-Type: text/html; charset=UTF-8
Date: Tue, 04 Mar 2014 21:44:51 GMT
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Last-Modified: Tue, 04 Mar 2014 21:44:51 GMT
Pragma: no-cache
Server: Apache
X-Pingback: http://promotions.glamour.com/xmlrpc.php
X-Powered-By: PHP/5.3.14
transfer-encoding: chunked
Connection: keep-alive
Wordpress randomly returning 404
I had a similar problem and I discovered the fix. Leaving this for whoever may come to this page as I did in search of a solution.
Turned out that it was because some plug-ins were causing a spike in memory consumption and the shared hosting (Dreamhost) was killing requests that took too much memory, and returned a 404 error. In my log files I was seeing "Premature end of script headers".
I disabled all non-critical plug-ins and not only have the random 404s stopped, but the site is loading much faster overall.
So it turns out the solution had nothing to do with Wordpress.
Long story short - a second duplicate server had been quietly set up to handle large traffic spikes, and our build scripts knew nothing about that new server and weren't deploying to it.
Ahh the joys of troubleshooting at a large company...
I am running Webricks/Thin server locally for my development environment however i couldn't get to return Etag in my response.
I've tried various options suggested on SO to add Etag or ConditionalGet rack middleware components but to no avail. Here is the snippet on my development.rb file
config.middleware.use Rack::Cors do
allow do
origins 'xyz:3000', 'abc:3000'
resource '*', :headers => :any, :methods => [:get, :post, :options]
end
config.middleware.insert_before(Rack::Cors, Rack::ConditionalGet)
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
Here is the sample response header from a request and thats missing the Etag header or HTTP_IF_NONE_MATCH and HTTP_IF_MODIFIED_SINCE headers and thus all requests return 200 OK and never the 304 Not Modified which
> curl --head -I mylocalhosturl
HTTP/1.1 200 OK
Last-Modified: Mon, 04 Feb 2013 23:49:11 GMT
Content-Type: application/json; charset=utf-8
Cache-Control: must-revalidate, private, max-age=0
X-Meta-Request-Version: 0.2.1
X-Ua-Compatible: IE=Edge
X-Request-Id: a06b5c3aeff8191ad22ab7d23433b076
X-Runtime: 0.217688
X-Rack-Cache: miss
X-Miniprofiler-Ids: ["470heu3ps6wht3tuqgdr","qdjrpkjus6pzw6ed28ex","egfngxkdtl2f2m1w7r9n","b3dlozxj3hyb9bq2i2fi","k7x41fq7anewz5jf0nm1","unojexyqklkjdew8dkti","rjwo48jd8pw8c0h0jb38","82d8g9o6agzoam7acxgi","tk577xwtgtfn7u1mrvqo","e8ih8byjbm2jfmbyl5tf"]
Content-Length: 0
Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-02-16)
Date: Mon, 03 Jun 2013 18:34:31 GMT
Connection: Keep-Alive
Set-Cookie: __profilin=p%3Dt; path=/
Set-Cookie: __profilin=p%3Dt; path=/
Set-Cookie: __profilin=p%3Dt; path=/
Interesting this is not an issue on production which uses similar configurations AFAIK but nginx/1.2.0 as the server. Any ideas on enabling Etags in rails development mode appreciated.
Remove rack-mini-profiler gem from your project and restart the server.
For some reason rack-mini-profiler gem will strip out the Etags. I found this SO post because I was looking to figure out why it strips out the Etags.
Update
You can also disable that behavior according to the Official Docs like this
Rack::MiniProfiler.config.disable_caching = false
Please note that disabling that behavior may introduce some nasty bugs with rack-mini-profiler as mentioned in the documentation
This has been bugging me for a while now. Whenever I try to share my website link on Facebook or another link-sharing site, the link-sharing site either removes the URL (like it doesn't recognize it as valid) or in Facebook's case - it can't retrieve meta-data automatically.
I'm pretty sure that it used to work. However, Googling / StackOverflowing for this problem is a difficult task, since I have no idea what possibly could create this problem.
I've tried to create a static .HTM file on my website, and that works fine:
test.htm
My default home page is a classic ASP (yeah I know, PHP version in the works) which uses IIS 7 URL Rewrite module.
I've tried to check the resultcodes and headers for both test.htm and my default home page on this page: http://gsitecrawler.com/tools/Server-Status.aspx
This is the results:
test.htm
URL=http://www.orango.nu/test.htm
Result code: 200 (OK / OK)
Content-Type: text/html
Last-Modified: Fri, 04 Feb 2011 10:16:55 GMT
Accept-Ranges: bytes
ETag: "0d877a654c4cb1:0"
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:40:08 GMT
Content-Length: 452
default home page /
URL=http://www.orango.nu
Result code: 200 (OK / OK)
Cache-Control: public
Content-Length: 13463
Content-Type: text/html; Charset=UTF-8
Accept-Ranges: bytes
Server: Microsoft-IIS/7.0
Set-Cookie: ASPSESSIONIDSCSADCAR=DLPBECCBGDJMADLEPMOMHDDC; path=/
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:24:22 GMT
The first 4 lines of my default.asp (/) file are:
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"
Does anyone have an idea what could be wrong and/or how to fix it? Any help or advice would be much appreciated, because this is driving me to the edge of madness.
The content-type looks wrong on your homepage...
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 13463
Content-Type: text/html;charset=UTF-8,text/html; Charset=UTF-8
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:48:39 GMT
I also don't see the need, at least for the homepage, for the cache-control: private header.
I Have a specific set of HTTP response headers I'm trying to recreate in ASP.NET.
Here is how it looks in Fiddler (Raw):
HTTP/1.1 200 OK
Content-Length: 570746
Content-Type: audio/wav
Last-Modified: Wed, 19 May 2010 00:44:38 GMT
Accept-Ranges: bytes
ETag: "379d676ecf6ca1:3178"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Tue, 05 Oct 2010 18:35:18 GMT
Here is how it looks on the Headers tab (same data. Different view)
I am trying to recreate the same set of headers (different values of course) with code, on an ASP.NET page. The biggest problem is with the cache settings and the ETag. It usually shows some "private" or similar cache setting and no ETag value, even though I'm trying to set it explicitly with
Response.Cache.SetETag
Have you tried something like this:
if (Response.Headers("ETag") == null)
Response.AddHeader("ETag", "379d676ecf6ca1:3178")
else
Response.Headers("ETag") = "379d676ecf6ca1:3178";