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

Mongrel response status Not Modified on headers change. #1

Open
bogdan opened this issue Mar 15, 2010 · 10 comments
Open

Mongrel response status Not Modified on headers change. #1

bogdan opened this issue Mar 15, 2010 · 10 comments
Labels

Comments

@bogdan
Copy link

bogdan commented Mar 15, 2010

Mongrel returns Not Modified response status if there was some changes in the headers of the page.

For instance:
I 've changed the Content-Type in order to fix a bug on browser side. But browser didn't manage to resolve that change.
It is strange that firefox doesn't have any problems and detects the header change.
But webkit inspector shows old headers values in inspector.
Maybe it is the WebKit bug or Rails bug.

But anyway I think that server should set response status to 200 in case when headers were changed.

Please, check if that could be a Mongrel related issue.

@luislavena
Copy link
Contributor

Hello,

If this a Mongrel thing, can you create a simple Handler (as described in the docs) to recreate the issue?

If is Rails, how you started Rails server? with script/server or mongrel_rails?

A simplified example with code and real output will help us faster pinpoint and replicate this issue.

Please add this to the ticket and we will confirm and prioritize

Thank you.

@bogdan
Copy link
Author

bogdan commented Mar 15, 2010

Launching with mongrel_rails cluster::start

class SampleController < AppController
def show
if crazy_condition
response['Content-Type'] = 'text/javascript'
else
response['Content-Type'] = 'text/html'
end
render :text => 'Hello' # assume response body is same in both cases.
end
end

See that in example above response text is the same but header is different.
First of all we do the request and crazy_condition is true:
200 Ok
Then we do the request 2nd time and crazy_condition is false:
304 Not modified

Body was not modified in fact but the header was changed.

How do you think is that correct?

Checked with webrick - not recreatable.

@luislavena
Copy link
Contributor

The following is the output of my test:

http://gist.github.com/354373

using script/server, using webrick, mongrel and thin. Also used mongrel and thin directly

I couldn't reproduce the 304 not modified.

Are you sure that there is no caching or anything interfering?

@bogdan
Copy link
Author

bogdan commented Apr 3, 2010

I was testing in Chrome. Possibly related to webkit. I will try on my own. Thanks anyway.

@luislavena
Copy link
Contributor

Hmn, the thing is that it might be possible the browser is not telling you the truth.

Can you test with Firefox and FireBug enabled? or basic curl calls, just to try that out.

It is kind of awkward that you're the first one reporting such issue.

@luislavena
Copy link
Contributor

Why did you close it?

@bogdan
Copy link
Author

bogdan commented Apr 3, 2010

Yes, I was to quick when I closed it.

Can you take a look at this: http://www.ubuntu-pics.de/bild/50414/screenshot_002_m3fKcc.png

Here you can see the result of ajax request I made second time after adding content type setter: Content-Type: javascript

Rails console says: 200 OK.
Browser says 304 Not Modified and Content-Type is 'html'.

Do you have any ideas of how that might happen?

@luislavena
Copy link
Contributor

Seems is an Ajax request, not an normal HTTP one.

So that means is not a response to normal html. Can you tell me specifically which version of Rails are you using?

Also, if you're running in development or production mode and more details of the request (a get request using Prototype? Jquery?)

Thank you.

@bogdan
Copy link
Author

bogdan commented Apr 3, 2010

Rails 2.3.5
Development mode.
Request generated using MooTools 1.2.4

@luislavena
Copy link
Contributor

Hello,

I've tried to replicate your scenario several times without success. Of course, always testing a single server and not cluster version.

If you can provide a simple rails app in a GitHub repository that I can clone and test out, will be great.

Going to set this on feedback until you can provide that.

Thank you.

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

No branches or pull requests

2 participants