On Feb 23, 4:23 pm, Alice Bevan–McGregor <[email protected]> wrote:

> I combine pytz (dateutil is excellent, too,) with user preference
> pre-populated by JavaScript timezone detection and optional "relative
> times", which improve caching substantially.
>
> E.g. you render UTC in your template and cache the result.  A JS script
> called "timeago" then finds all <time> tags (or the selector of your
> choice, e.g. <span rel="time">) and converts them to realtime-updated
> relative times e.g. "30 seconds ago".  These are updated on the page
> automatically, once per minute, without having to refresh.
>
> By reducing the amount of dynamic information (times rendered in
> different time zones) the pages can be etag cached far more easily.

Now that's an interesting approach I don't think I would have thought
of! Thanks for the idea. I don't think it would work very well in my
particular case because very little on my site is cacheable - pages
tend to be either trivially simple or hideously complex - but that's a
neat idea!

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to