Categorías
Citas Desarrollo web ECMAScript

IndexedDB

Estaba mirando la especificación de Indexed Database API (especificación del W3C desde el 2015), pero gracias al siguiente tutorial, me he enterado mucho mejor. Y aquí lo dejo.

A website can have one or more IndexedDB databases. Each database must have a unique name.

A database can contain one or more object stores. An object store, which is also uniquely identified by a name, is a collection of records. Each record has a key and a value. The value is an object that can have one or more properties or attributes. The key can be based on a key generator, derived by a key path, or explicitly set. A key generator automatically generates a unique sequential positive integer. A key path defines the path to the key value. It can be a single JavaScript identifier or multiple identifiers separated by periods.

The specification includes both an asynchronous and a synchronous API. The synchronous API is meant to be used within web workers. The asynchronous API uses requests and callbacks.

Brian StewartUsing the HTML5 IndexedDB API

Categorías
Citas Desarrollo web Libros

Sugerencias para mejorar el peso y rendimiento de las páginas webs

Acabo de leer el —brevísimo— libro Web Page Size, Speed, and Performance, escrito por Terrence Dorsey y publicado por O’Reilly (la descarga es gratuíta).
El contenido del libro, como podrás imaginar, consta de consejos para mejorar el peso y rendimiento de una página web. Y creo que cada vez hay que valorar más aspectos como el peso y el rendimiento, teniendo en cuenta la tendencia actual. Cualquier «doctor web» nos diría hay un evidente sobrepeso.
Se puede encontrar una cita cuyo origen está en el mundo de la automoción, aplicable perfectamente al desarrollo web:

Simplify, then add lightness.

Collin Chapman

Sugerencia: puedes aprovechar para procasti…, digo, para ampliar tus bastos conocimientos leyendo un poco sobre Collin Chapman y la empresa de coches que fundó, Lotus.
Continuando, si es que se puede, en el libro aparecía un colofón con unos cuantos consejos, que cito a continuación:

  1. Start by measuring the size, request latency, and load time of your current site on various devices. You can do this right in the browser.
  2. Use online tools to measure more advanced site performance metrics and compare them against industry average.
  3. Know how long your page takes to finish rendering and what the time is to the first interaction. This is your first-impression metric.
  4. Evaluate your business goals and try to correlate site performance with traffic, conversiones, revenues, or whatever metrics is relevant to your business.
  5. Count all of the components that have to be requested to render your page Can you reduce this number?
  6. Slim down your HTML. Combine and minfiy your CSS files.
  7. Take a close look at where you reference scripts and when they excecute. Are scripts blocking page rendering or interaction?
  8. Make sure you’re using images wisely and optimizing them for size and quality. A little bit of code can make sure you’re not sending too many image bytes where they’re not needed.
  9. Don’t throw out social features just because they add to your request, scripts, and page size if they benefit the business; just be sure to use them tactically instead of spreading them all over the place.
  10. Starting with a focus on the mobile experience —most likely your fastest growing customer experience— may help you target performance optimizations that benefit all visitors to your site, even those using the desktop.