Reputation: 292
The Google Blobstore recently added support for serving partial byte ranges from a blob. When this method is invoked the response is generated with a HTTP 206 (Partial Content) status code. So it looks like app engine assumes that it is always serving a Range request in this case.
However, in my case I have bundled many files into one blob entry and I know the byte range of each. From the client's perspective they only access a URL representing an individual file. Behind the scenes, I invoke the ByteRange based serve method on the blob store to serve the file. HTTP 200 is the more appropriate response in my case however the app engine always returns 206.
Is there a way to override this behavior? (i.e. return 200 instead of 206?)
Thanks, Keyur
Upvotes: 1
Views: 624
Reputation: 5452
TBH 206 is the correct code, because even if the client see's it differently, the server is still sending only part of the blob.
Technically, response codes are partly there to aid and enable caching, if it returns 200 OK to a range request then only a partial entity would be cached by interim proxies which would assume (rightfully) that it is the complete entity, which would mess up responses to further requests. Must always consider the effects on cache's, they make much of the web work.
Sorry, I don't know :)
Upvotes: 1