best-practice   1972

« earlier    

Essential Image Optimization
A free book on modern image optimization techniques. Formats, decoders, techniques for efficient compression and more are covered. Author: Addy Osmani
web-dev  web-design  image  guide  best-practice  optimization 
yesterday by aagd
Best Practices for Designing a Pragmatic RESTful API | Vinay Sahni
Pretty print by default & ensure gzip is supported

An API that provides white-space compressed output isn't very fun to look at from a browser. Although some sort of query parameter (like ?pretty=true) could be provided to enable pretty printing, an API that pretty prints by default is much more approachable. The cost of the extra data transfer is negligible, especially when you compare to the cost of not implementing gzip.

Consider some use cases: What if an API consumer is debugging and has their code print out data it received from the API - It will be readable by default. Or if the consumer grabbed the URL their code was generating and hit it directly from the browser - it will be readable by default. These are small things. Small things that make an API pleasant to use!

But what about all the extra data transfer?

Let's look at this with a real world example. I've pulled some data from GitHub's API, which uses pretty print by default. I'll also be doing some gzip comparisons:


$ curl https://api.github.com/users/veesahni > with-whitespace.txt
$ ruby -r json -e 'puts JSON JSON.parse(STDIN.read)' < with-whitespace.txt > without-whitespace.txt
$ gzip -c with-whitespace.txt > with-whitespace.txt.gz
$ gzip -c without-whitespace.txt > without-whitespace.txt.gz
The output files have the following sizes:

without-whitespace.txt - 1252 bytes
with-whitespace.txt - 1369 bytes
without-whitespace.txt.gz - 496 bytes
with-whitespace.txt.gz - 509 bytes
In this example, the whitespace increased the output size by 8.5% when gzip is not in play and 2.6% when gzip is in play. On the other hand, the act of gzipping in itself provided over 60% in bandwidth savings. Since the cost of pretty printing is relatively small, it's best to pretty print by default and ensure gzip compression is supported!
REST  api  best-practice  blog 
13 days ago by ndf
Web Page Footers 101: Design Patterns and When to Use Each
As UX professionals, we tend to dedicate our time and energy to everything above the fold. That’s because global navigation, search, and high-priority content are positioned above the fold and users tend to spend a disproportionate amount of their time at the top of any given page.
footers  best-practice  design-patterns 
17 days ago by richardsison
Component Discovery and Collaboration · Bit
Bit is where developers share components and collaborate to build amazing software together. Discover components shared by your team and developers around to build new apps faster. Share code components between projects and collaborate to share, use and develop them anywhere. Join today.
react  angular  vue  component-library  service  app  collaboration  webdevelopment  best-practice  pattern-library  ui  components  design  style-guide 
25 days ago by ilijusin

« earlier    

related tags

12factor  @codingcontest  advice  ai  amazon  analysis  andrew-ng  android  angular  anti-patterns  antipatterns  api  apis  app  architecture  arguments  article  assertj  autocomplete  aws  best-practices  best  bestpractice  bestpractices  blog  browsers  build  businessmodel  canonical-answers  cedar  checklist  cli  clojure  cloud  cmdline  code  coding  collaboration  collection  comments  compilation  complex  component-library  components  content-design  content-strategy-example  content-strategy  continuous-delivery  continuous-deployment  cooking  cookware  coprocessor  css  cursor  data  datenbank  deep-learning  deployment  design-pattern  design-patterns  design  develop  development  devops  digital-transformation  distilled-knowledge  docker  dockerfile  documentation  elearning  em  entwicklung  example  fe  feature  file  flag  flatten  font  fonts  footers  form  gallery  gems  git  github  go  golang  google  gtd  guidance  guide  guideline  guidelines  hbase  hiring  hosting  hub  image  images  interview  ios  javascript  journals  js  junit5  jupyter  kotlin  kubernates  kubernetes  learncode  learndesign  learning  learningguide  linux  lists  logging  make  management  marketing  media  meinungen  mistakes  ml  mobile  monitoring  network  networking  nlp  node  nodejs  nützlich  official  optimization  parent  pattern-library  pattern  performance  phoenix  php  pixel  practice  practices  productivity  programmierung  programming  projektmanagement  publishing  python  queries  query-tuning  react  reference  rem  remote-working  resource  resources  rest  rwd  sales  scala  scaling  security  serverless  service  severless  shell  sicherheit  slides  software  space  spacing  spark  spreadsheets  sql  ssh  startups  static  style-guide  suggestions  sysadmin  system  tableau-server  tableau  tensorflow  terminal  testing  threading  tips  tunnel  tutorial  type:collection  type:guide  type:presentation  type:tool  type:website  typography  ui  unit-testing  unix  unread  ux  vim  vue.js  vue  vuejs  vuex  web-design  web-dev  webdev  webdevelopment  writing 

Copy this bookmark:



description:


tags: