KBD

Keith Devens .com

Saturday, March 20, 2010 Flag waving
"To know what *would* have happened, child?" said Aslan. "No. Nobody is ever told that." – C.S. Lewis (Aslan, in Prince Caspian, Chapter 10)
← Comment RSS feedsGreat quote →

Daily link icon Saturday, June 14, 2003

Time Since

I think I like Simon's new time since feature (you can't see it unless you go to the home page). I think I've seen similar things elsewhere but I can't remember where. It might be a little distracting on his home page since it's kind of big. But, thanks to his girlfriend Natalie for making the code available. If I can find a place to put it I may use it.

Hey, she uses the exact same type of URL scheme I do. Score.

The only reason I think the time since may not be the best idea is because it has to change every time the page loads, as opposed to the time of a post which is static. This would seriously hurt static caching. However, Simon's point that it erases the time zone distinction is a really good one. But because of the caching issue alone I don't think I'd want to use it.

My whole philosophy while developing my CMS has been that even if some things are more inefficient than they would be without the CMS, it's more important to make things easy to use, because whatever inefficiencies there are can be completely eliminated by having pages cached and served from static files.

← Comment RSS feedsGreat quote →

Comments XML gif

Simon Willison (http://simon.incutio.com/) wrote:

Yup the static caching thing caught me out soon after I installed it - I've had to knock the timeout on the front page down from 5 minutes to 1 minute to keep the time since thing updating properly.

If caching is an issue, a nice alternative is to generate the time_since information using javascript. With careful use of the DOM you can get the time since bit to appear in browsers that support the DOM and be silently skipped in older browsers, which isn't a problem as it's not an essntial part of the page. Hixie does this on http://ln.hixie.ch/ using some pretty funky Mozilla specific stuff.

∴ Simon Willison | 14-Jun-2003 11:30pm est | http://simon.incutio.com/ | #2193

Keith (http://www.keithdevens.com/) wrote:

Awesome, I'll check that out. I considered Javascript too. I've been sour on the whole client-side scripting thing in general, and especially fed up with the whole thing when I found out that you have to write to the browser in a completely different way if the page is XHTML. That was in an article by Mark Pilgrim on xml.com, I think, but I can't find it in my weblog archive.

Keith | 14-Jun-2003 11:56pm est | http://www.keithdevens.com/ | #2194

Simon Willison (http://simon.incutio.com/) wrote:

Hehe tell me about it - when I switched my site to being served with application/xhtml ALL of my scripts stopped working on the spot! I figured out the solution the other day - you need to switch to using document.createElementNS in Mozilla but keep using document.createElement in IE. I've got a function to do just that in my blockquotes code now: http://simon.incutio.com/blockquotesNS.js

∴ Simon Willison | 15-Jun-2003 6:24am est | http://simon.incutio.com/ | #2195

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.23s.

(Used 8 db queries)