Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP's 412 (Precondition Failed) handling for .obj and .mtl files #129

Open
GoogleCodeExporter opened this issue May 1, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Init sample object on a page running on an iPad's Safari with iOS 8.0 or 
8.1.1
2. Then reinit object without refreshing the page
3. It was tested on Apache 2.2.+

What is the expected output? What do you see instead?
After reinit 3d objects can't be loaded properly.

What version of the product are you using? On what operating system?
Safari, iPad, iOS 8.0 or 8.1.1, Apache 2.2.+

Please provide any additional information below.
jsc3d uses XMLHTTPRequest's POST method for loading static files. After second 
use of the same 3d model without refreshing a page, browser tries to use a 
cached version of the file and receives 412 status from the server so the 
library can't load the files properly. According to RFC 2616 which is a 
specification for HTTP/1.1 protocol http://www.ietf.org/rfc/rfc2616.txt 
receving 412 status seems to be ok when http client tries to use a cache of the 
content with the POST method and it is a counterpart of 304 Not Modified status 
for GET method. In my opinion the library should also handle 412 status by 
trying to load a file in the next attempt by using GET method or every time 
while loading obj/mtl files with POST should add some random variable (e.g. 
timestamp) to their urls. It can also use GET instead of POST.
Of course the problem could be fixed by not attaching the HTTP's ETag header 
(which is used for caching) by the server sending obj/mtl files or by not 
initializing the same 3d objects more than once without refreshing the page. 
But I use a 3rd-party software which uses jsc3d library in that manner so it is 
not the case to fix this there.

Original issue reported on code.google.com by [email protected] on 26 Nov 2014 at 12:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant