Archive for September, 2014

Finding out the size of localStorage

In the next update of Process Street we are adding more caching to our front end JavaScript client (named Front Street after the street in Toronto) in an effort to make the experience of using our app as fast as possible.

Front Street uses web storage (specifically localStorage) to store persistent user data. To make the cache as effective as possible, it should be able to grow to use as much space as it can. However, we also store other information in localStorage, like user session information (the user’s login token and list of teams, for example). That means if the cache grew to use all the localStorage space, the app couldn’t function properly. Thus, we needed a way to detect the size of localStorage so we could partition localStorage between cache and session information.

Read more »

Forcing HTTPS in a Play 2 Scala app

At Process Street we’ve been developing a new app called MailTheme that, like the Process Street app, it uses the Play Framework.

Unlike Process Street, MailTheme will be running on Google Cloud and, for the time being, won’t be behind a load balancer or proxy. As such, I needed to make all HTTP requests auto-redirect to HTTPS via Play. This turned out to be more difficult than I first imagined, as Play prior to version 2.3 has no way to detect whether or not the incoming request is over SSL.

Read more »