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

Use HTTP HEAD to determine if polling should fetch new data or not. #17

Closed
flexd opened this issue May 19, 2014 · 4 comments
Closed

Use HTTP HEAD to determine if polling should fetch new data or not. #17

flexd opened this issue May 19, 2014 · 4 comments

Comments

@flexd
Copy link

flexd commented May 19, 2014

A HEAD request returns the Content-Length header, which as you see here can be a good indicator to check if the content has changed:

sonar_contentlength

For larger requests, a lot of bandwidth can be spared if Intercooler does a HEAD request to check if the data has been updated, instead of doing a full GET request and then comparing the data.

@elmigranto
Copy link

Same length does not mean that data hasn't changed, does it?

@flexd
Copy link
Author

flexd commented May 28, 2014

A different length would indicate something has changed.

You can't be sure, but the web server returns everything but the actual content on a HEAD request, so for example etags and all the other headers will be identical, so you can see if content has changed.

@elmigranto
Copy link

Yes, it would. Now, what would same lengths mean? What I am saying is you can not make such desicion based on Content-Length header. It serves a different purpose.

On the other hand, checking for something like ETag or If-Modified-Since could help. But I believe browsers already do that for you.

@1cg
Copy link
Contributor

1cg commented Feb 5, 2015

Closing. I'd like the browser to handle this by interpreting standard HTTP response codes, like 304

@1cg 1cg closed this as completed Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants