5 ms·
This is the first blog post I wrote and actually published. Any comments on content, but also writing style etc are very welcome!
by asm89 14y ago
This is the first blog post I wrote and actually published. Any comments on content, but also writing style etc are very welcome!
- EwanToo 14y agoI 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.
- asm89 14y agoAh 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!
- iaskwhy 14y agoIt'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!
- asm89 14y agoI took the photographs with my phone, next time I'll use a better camera. Changing the red is probably a good idea anyway. Thanks!
- mmcnickle 14y agoI 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.
- asm89 14y agoHm, 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!
- aw3c2 14y agoWhite balance those photographs! Also you can make them much smaller with no apparent loss. http://i.imgur.com/EQulv.jpg http://i.imgur.com/EQulv.jpg
- asm89 14y agoNext time I'll take the photographs with a dslr camera instead of my phone. :)
- jakemcgraw 14y agoExcellent 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.
- asm89 14y agoThanks! As for the examples, I think I will write some follow-up articles with more concrete use-cases and features of Varnish.
- michaelmior 14y agoInteresting 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.
- asm89 14y agoThe 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.