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

  • instagram cross-post

    I think Gideon likes me. (He just crawled the length of the room, climbed on to the sofa, and rested his head on my shoulder) Original is…

  • Interesting Links for 31-07-2021

    MPs condemn shocking conditions for asylum seekers in Dover (tags: UK asylum OhForFucksSake ) A brief history of The Yoghurt Wars (tags:…

  • instagram cross-post

    My ladies of the castle. Original is here on instagram. Original post on Dreamwidth - there are comments there.

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 23 comments

  • instagram cross-post

    I think Gideon likes me. (He just crawled the length of the room, climbed on to the sofa, and rested his head on my shoulder) Original is…

  • Interesting Links for 31-07-2021

    MPs condemn shocking conditions for asylum seekers in Dover (tags: UK asylum OhForFucksSake ) A brief history of The Yoghurt Wars (tags:…

  • instagram cross-post

    My ladies of the castle. Original is here on instagram. Original post on Dreamwidth - there are comments there.