# Proxy\_cache incomplete file?

**URL:** <https://www.ruby-forum.com/t/proxy-cache-incomplete-file/205633>\
**Category:** NGINX\
**Created:** [April 11, 2011, 9:57pm UTC](https://www.ruby-forum.com/t/proxy-cache-incomplete-file/205633 "2011-04-11T21:57:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 11, 2011, 9:57pm UTC](https://www.ruby-forum.com/t/proxy-cache-incomplete-file/205633/1 "2011-04-11T21:57:43Z")

</div>

Hi Guys, please observe the following…

wget -S  
[http://blah.com/j%2FoRjj0RRdJu3IWYoBIbgtIiI%2FoV%2Fvtl%2BxzcX1Km0OCZbxBDJDtqb8afEWpOaizmrTv9MWUPyjqNlFbVyezfJaP%2FzIv0M5yFt0IrKWjMTW1x5r1RHLObU2ylE3EhjZssc19qxfAer6RL7W7HhjwBZBSNfCO7c6JW1ElNGiSfXuY%3D/WoW-3.0.1-to-3.0.2-Update.zip](http://blah.com/j%2FoRjj0RRdJu3IWYoBIbgtIiI%2FoV%2Fvtl%2BxzcX1Km0OCZbxBDJDtqb8afEWpOaizmrTv9MWUPyjqNlFbVyezfJaP%2FzIv0M5yFt0IrKWjMTW1x5r1RHLObU2ylE3EhjZssc19qxfAer6RL7W7HhjwBZBSNfCO7c6JW1ElNGiSfXuY%3D/WoW-3.0.1-to-3.0.2-Update.zip)  
–2011-04-11 20:39:20–  
[http://blah.com/j%2FoRjj0RRdJu3IWYoBIbgtIiI%2FoV%2Fvtl%2BxzcX1Km0OCZbxBDJDtqb8afEWpOaizmrTv9MWUPyjqNlFbVyezfJaP%2FzIv0M5yFt0IrKWjMTW1x5r1RHLObU2ylE3EhjZssc19qxfAer6RL7W7HhjwBZBSNfCO7c6JW1ElNGiSfXuY%3D/WoW-3.0.1-to-3.0.2-Update.zip](http://blah.com/j%2FoRjj0RRdJu3IWYoBIbgtIiI%2FoV%2Fvtl%2BxzcX1Km0OCZbxBDJDtqb8afEWpOaizmrTv9MWUPyjqNlFbVyezfJaP%2FzIv0M5yFt0IrKWjMTW1x5r1RHLObU2ylE3EhjZssc19qxfAer6RL7W7HhjwBZBSNfCO7c6JW1ElNGiSfXuY%3D/WoW-3.0.1-to-3.0.2-Update.zip)  
Resolving [blah.com](http://blah.com)… 83.x.x.x  
Connecting to blah.com|83.x.x.x|:80… connected.  
HTTP request sent, awaiting response…  
HTTP/1.1 200 OK  
Date: Mon, 11 Apr 2011 19:28:08 GMT  
Content-Type: application/zip  
Connection: keep-alive  
Content-Length: 408013880  
Last-Modified: Wed, 15 Oct 2008 00:38:52 GMT  
Content-Disposition: attachment;  
filename=“WoW-3.0.1-to-3.0.2-Update.zip”  
X-Cached-New-L2: 98.x.x.x:80 (origin server)  
X-Cached-L2: MISS  
X-Cached-L1: HIT  
X-Content-Length: 408013880  
Accept-Ranges: bytes  
X-Limited-After: 0  
X-Limited: 512000  
Length: 408013880 (389M) [application/zip]  
Saving to: `WoW-3.0.1-to-3.0.2-Update.zip.4’

4% [\>] 19,455,578 --.-K/s in  
1m 44s (it stalls here then times out)

2011-04-11 20:41:04 (184 KB/s) - Connection closed at byte 19455578.  
Retrying.

–2011-04-11 20:41:05-- (try: 2)  
[http://blah.com/j%2FoRjj0RRdJu3IWYoBIbgtIiI%2FoV%2Fvtl%2BxzcX1Km0OCZbxBDJDtqb8afEWpOaizmrTv9MWUPyjqNlFbVyezfJaP%2FzIv0M5yFt0IrKWjMTW1x5r1RHLObU2ylE3EhjZssc19qxfAer6RL7W7HhjwBZBSNfCO7c6JW1ElNGiSfXuY%3D/WoW-3.0.1-to-3.0.2-Update.zip](http://blah.com/j%2FoRjj0RRdJu3IWYoBIbgtIiI%2FoV%2Fvtl%2BxzcX1Km0OCZbxBDJDtqb8afEWpOaizmrTv9MWUPyjqNlFbVyezfJaP%2FzIv0M5yFt0IrKWjMTW1x5r1RHLObU2ylE3EhjZssc19qxfAer6RL7W7HhjwBZBSNfCO7c6JW1ElNGiSfXuY%3D/WoW-3.0.1-to-3.0.2-Update.zip)  
Connecting to blah.com|83.x.x.x|:80… connected.  
HTTP request sent, awaiting response…  
HTTP/1.1 502 Bad Gateway  
Date: Mon, 11 Apr 2011 19:29:53 GMT  
Content-Type: text/html  
Connection: keep-alive  
Content-Length: 177  
2011-04-11 20:41:05 ERROR 502: Bad Gateway.  
(some browsers/downloaders seem to retry many times per second when they  
get a 502… very annoying!)

This behaviour is always repeatable on this file (but only happens in  
very rare circumstances).  
It seems as if nginx hasn’t got the fully cached file yet reports the  
full content-length.  
If I use cache\_purge to wipe the file and request again the issue is  
resolved and it gets the full file from the origin  
What could be the cause/solution?

Many thanks as always
