Andrew Ducker (andrewducker) wrote,
Andrew Ducker
andrewducker

Question for the web-devs in the audience

So, in order to capture the user's Timezone* I'm giving the user a dropdown with all of the allowed timezones. The new one has a popup for each possible output** - so that data is duplicated. And having checked, that's 18kB of options, repeated twice. 36000 characters of data being generated twice and then sent over the wire, every time a page is served.

This seems silly, as I don't actually expect people to pop up that combo box very often. Most of the time it's hidden invisibly in the background***

So, should I do something clever using JavaScript to fetch the list of allowed timezones when needed and then create the options on an ad-hoc basis? That risks slowing everything down for a second while it fetches the list over AJAX and then creates 600-odd entries, but shaves some time off the load. Or avoid doing this on the client in order to keep processing on the server where the majority of the page is generated, on the grounds that 36k is trivial by modern standards, and it's ok to waste that? Or add it into a separate JS file so that at least it's only loaded the once and then cached from then on****? Or something else?

Thoughts?

*For LJ/DW, which insists on having a time passed with each post, and mustn't have a time passed in before the current one - but takes that _in_ the user's local timezone, so I have to do the conversion before making the call. API here.
**i.e. LJ, DW, Wordpress, and any others I add later. Probably Tumblr, at the least.
***Iin the new version - clearly in the current one it's visible all the time.
****Which I only thought of at the end of writing this, and now seems most sensible. After all, they're loading jQuery whenever they hit my page, and that's 92k, and also cached.




Original post on Dreamwidth - there are comment count unavailable comments there.
Subscribe

  • Interesting Links for 28-11-2021

    Why representation is important (tags: LGBT neilgaiman death fiction ) No, viruses do not automatically evolve to be less deadly (tags:…

  • Interesting Links for 27-11-2021

    The Highest City in the World Celebrates Its Indigenous Culture with Neo-Andean Architecture (tags: design Bolivia architecture colour )…

  • Interesting Links for 26-11-2021

    Will glow-in-the-dark materials someday light our cities? (tags: light ) Why a Mass Effect TV show is a terrible idea (tags: TV games writing…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 23 comments

  • Interesting Links for 28-11-2021

    Why representation is important (tags: LGBT neilgaiman death fiction ) No, viruses do not automatically evolve to be less deadly (tags:…

  • Interesting Links for 27-11-2021

    The Highest City in the World Celebrates Its Indigenous Culture with Neo-Andean Architecture (tags: design Bolivia architecture colour )…

  • Interesting Links for 26-11-2021

    Will glow-in-the-dark materials someday light our cities? (tags: light ) Why a Mass Effect TV show is a terrible idea (tags: TV games writing…