Re:Context-aware HTTP caching (with Varnish)
by asm89 on Wednesday September 26, 2012 @05:06AM
(#4574767)
This is the first blog post I wrote and actually published. Any comments on content, but also writing style etc are very welcome!
[ Parent
| on HN ]
Re:Context-aware HTTP caching (with Varnish)
by mmcnickle on Wednesday September 26, 2012 @06:13AM
(#4574912)
I thought it was a great introduction to the topic. I found the jump to pre-authentication a little jarring, perhaps adding an explanation as to why caching logged-in users is a problem would help.
In the later examples, I don't think it's very clear that you're using the timestamps to show which responses are fresh and which are cached. Coloring the fresh/cached responses differently in the output might help.
Look forward to your next post.
Re:Context-aware HTTP caching (with Varnish)
by asm89 on Wednesday September 26, 2012 @06:35PM
(#4578378)
Hm, I'm not sure how to introduce the pre-authentication bit even further. Maybe it isn't the best subtitle.
I agree that colouring the output could make things more clear. I'll keep it in mind for future articles!
Re:Context-aware HTTP caching (with Varnish)
by aw3c2 on Wednesday September 26, 2012 @06:19AM
(#4574920)
White balance those photographs! Also you can make them much smaller with no apparent loss. http://i.imgur.com/EQulv.jpg
Re:Context-aware HTTP caching (with Varnish)
by asm89 on Wednesday September 26, 2012 @06:19PM
(#4578323)
Next time I'll take the photographs with a dslr camera instead of my phone. :)
Re:Context-aware HTTP caching (with Varnish)
by jakemcgraw on Wednesday September 26, 2012 @08:05AM
(#4575155)
Excellent job... I think a second article in which you give specific examples of how Context-aware caching would work for a simple application would be helpful. Maybe a group chat service would be a great example. Also, adding HTTP requests within Varnish allows for a much more useful cache invalidation scheme... for example, incoming requests could have an content_token and timestamp. An internal HTTP service that records whether a given piece of content has expired (through user action rather than TTL) could then be checked before serving up a cached copy.
Re:Context-aware HTTP caching (with Varnish)
by asm89 on Wednesday September 26, 2012 @06:02PM
(#4578280)
Thanks! As for the examples, I think I will write some follow-up articles with more concrete use-cases and features of Varnish.
Re:Context-aware HTTP caching (with Varnish)
by EwanToo on Wednesday September 26, 2012 @06:07AM
(#4574900)
I think it's really good. One thing I'd change (not that I'm a good writer/blogger) is a clearer description in the first paragraph of why you'd want to do this.
"By using context aware caching, you can achieve high levels of caching for both anonymous and logged in users, unlike a dumb cache which generally excludes logged in user requests" or something like that.
Re:Context-aware HTTP caching (with Varnish)
by asm89 on Wednesday September 26, 2012 @06:15PM
(#4578313)
Ah yes, the introduction talks about caching, but doesn't say anything about the title. I'll try to keep this comment in mind next time!
Re:Context-aware HTTP caching (with Varnish)
by michaelmior on Wednesday September 26, 2012 @08:18AM
(#4575187)
Interesting as I'm not too familiar with Varnish. However it seems to me like it would be easier in many cases to pull out the session ID and then have a simple script which uses that to set the X-Auth-User header since most sites using authentication do so with session cookies.
Re:Context-aware HTTP caching (with Varnish)
by asm89 on Wednesday September 26, 2012 @06:04PM
(#4578285)
The approach described in the blog post can be used with all sorts of authentication schemes. I used an access token as example, but you could also use the "Cookie" header to get a session id.
Re:Context-aware HTTP caching (with Varnish)
by iaskwhy on Wednesday September 26, 2012 @06:07AM
(#4574901)
It's just very good, please do continue. Also, the drawings are cool but that dark red is not contrasty enough with the number inside it, you might want to improve that for the upcoming posts. Keep up the good writing!