Real world test of whether using CURIE notation in URLs actually reduces filesize after gzip compression.
Example taken from:
Results:
Before gzip compression:
{ | |
"_links":{ | |
"self":{ | |
"href":"/users" | |
} | |
}, | |
"_forms":{ | |
"create-user":{ | |
"title":"Create a new widget", | |
"description":"Enter your widget info and submit to create a new widget", |
Real world test of whether using CURIE notation in URLs actually reduces filesize after gzip compression.
Example taken from:
Results:
Before gzip compression:
example: http://halform.herokuapp.com/
require 'hactor' | |
class HomeActor | |
include Hactor::Actor | |
def on_200(response) | |
response.follow 'ht:users', actor: UserListActor.new | |
end | |
end |
{ | |
"_links": { | |
"self": { | |
"href": "/product/987" | |
}, | |
"manufacturer": { | |
"href": "/manufacturer/328764", | |
"title": "Manufacturer Inc." | |
} | |
}, |
{ | |
"_links": { | |
"self": { "href": "/foo" }, | |
}, | |
"_controls": { | |
"attack": { | |
"target": "/attacks", | |
"method": "POST", | |
"headers": { | |
"Content-Type": "application/json" |
require 'rspec' | |
class DevOps | |
attr_reader :monitor | |
def initialize(arguments) | |
@monitor = arguments.fetch(:monitor) { Monitor.new } | |
end | |
def check |
require_relative 'deferrable' | |
require_relative 'slime' | |
class WidgetsController | |
include ControllerSlime | |
def create | |
creator = WidgetCreator.new(attributes: params[:widget]) | |
creator.done do |widget| |
<!doctype html> | |
<head> | |
<title>An example tweet</title> | |
</head> | |
<body xmlns:ht="http://haltalk.herokuapp.com/rels/"> | |
<form class="properties" action="" method="POST"> | |
<input type="hidden" name="_method" value="PUT" /> | |
<input name="content" value="Justin Bieber is grate!111" /> | |
<input name="created_at" value="2012-07-07T22:35:33+00:00" /> | |
<button>Update</button> |
class Organization | |
def to_param | |
"42" | |
end | |
def saved? | |
rand > 0.5 | |
end | |
end | |