Post 40 - Heading for a snack
I’m now at over 40 posts and the streak is at 46. Not a bad difference considering some of the days I had trying to keep the streak alive but not enough time to write about it. The home page is getting kind of long, so in addition to the archive I’m trying to get working, I think I need to also incorporate a paginate, although the newest gem for Jekyll apparently doesn’t work with GitHub Pages. I’ll have to add that to the list of things to get sorted. Now as Zaphod and Ford say - to business.
Headers
Headers are additional bits of data you can send to the web server when making requests. No headers are strictly required by HTTP but it’s difficult to view a page properly with them.
Common request headers:
- Host - Some web servers host multiple websites, so by providing the host header you can specify the one you want, otherwise you receive the default site
- User-Agent - Browser software and version number to help the server format the website properly for your browser, and whether to provide browser specific HTML, JavaScript, and CSS
- Content-Length - Provides a completeness check for the server to make sure it receives all data being sent for things like forms
- Accept-Encoding - Tells the server what compression methods are accepted by the browser to make data smaller for transmitting
- Cookie - Data sent to the server to help remember your information
Common response headers:
- Set-Cookie - Information to store that gets sent back to server with each request
- Cache-Control - How long to store response content in the browser cahce before requesting again
- Content-Type - Tells client what type of data is being returned (HTML, CSS, JS, images, video, PDF, etc.) helping the broswer to process the data
- Content-Encoding - What method of compression was used to send data
The Questions
Three questions about what header is used in what situation.