A pattern for your consideration, about using Ajax to help pages be RESTful.
How to personalize content and make pages cacheable and bookmarkable at the same time?
- We want pages to have clean URLs that describe the main content being viewed. Doing so makes pages easily bookmarkable and send-to-friend-able, and also allows us to cache the page anywhere along the way. For example, viewing info about Fight Club should be http://example.com/fightclub and not http://example.com/fightclub/user-mahemoff or http://example.com/fightclub/287490270-1931321-cijE12ZSz .
- We want to personalize pages – say Hi to the user, show them personalized recommendations, etc.
- If we personalize, but use the same URL for all users, we break REST and therefore won’t be able to cache any content. My http://example.com/fightclub is different to your http://example.com/fightclub because we each see our own recommendations inside the page.
- But if we use diferent URLs for personalization, we can’t cache across users and pages aren’t sent-to-friend-able. If I look up and see http://example.com/fightclub/user-mahemoff, I’m probably not going to bother sending you the URL. Furthermore, my view of the page can’t be cached.
- Post by Bill Venners
- @rtweb Design: Thinking about RESTful dynamic web applications
- RESTful Service @ AjaxPatterns Note that it’s about Services, whereas this pattern sketch is about RESTfulness of the actual page.