Tokens are immutable. Use a new token if you need to change your payment address or secret base URL. You can create multiple tokens with identical payment addresses and secret base URLs.

Create a new token

Use the form bellow to create a new token:

Create token API

Request example

POST https://api.goblincompute.com/v0/token
Content-Type: application/json

  "address": "49JyyzdZ1t6VYbMSL6cjAQccdYQhkQyAjGHCoC8Crz5D1zx33eWxMQrZxDKmsRFAKqQMDo785hQ8KckkdkDNYcJuTDPtt4z",
  "base_url": "https://example.com/white-rabbit-horse-staple"

Response example

HTTP/1.1 201 Created
Content-Type: application/json

  "token": "dcdb6c4633158a802b410269d6de62f283ac2717bee7870a216ee40aefcb2d7a",
  "expiration": "2019-10-13T04:53:56.327996-04:00"

API deprecation

Please subscribe to receive API version deprecation anouncements that will be made in the future.

Content hosting

Goblin is a CDN

Goblin distribute your content just like a content delivery network, and caches your files for best performance and user experience. This means that your secret URL should ideally not point to a CDN, and that your files or responses should be configured with sensible caching headers. Google has a good introduction to HTTP Caching.

Caching minimum

If your content is not cacheable, we may nonetheless apply a cache of up to two minutes to meet performance and cost guarantees.

Maximum content size

The maximum content size of a single file or response is currently capped at 1MB. If you have an application where this is limiting, please let our support know.

No referer Header

We currently do not pass the HTTP referer down to your secret host nor do we read it on our proxy. We cannot think of an application where the value outweight privacy exposure, so in accordance with our Privacy Policy's principles, it is currently disabled. If you have an application or problem scenario that may invalidate this assumption, please let our support know.

Query string support

You can include a query string at the end of your partial URL (data-path), it will be passed down to your data source and cached independently.

Flushing cache

Flushing cache directly is not possible, however you can add a random query string at the end of the end of the file path such as ?123 or change your secret base URL and obtain a new token to start fresh. Content is cached ephemerally, and may be cleared when we make an update, even if you made a long-lasting cache declaration.

Widget usage

Embed rev. v0

No self-hosting

Non-breaking updates such as bug fixes or improvements are made to the widget on an ongoing basis, for this reason self-hosting is not supported.

Widget updates

When you obtain a new token, you should check back this document to ensure that the widget's main revision has not changed, as it may no longer be distributed before your new token expires.

Customizing script load

The script tag from the embed code must always be after the .goblin-widget div, but you can customize its loading behavior by replacing async with defer, or placing it at the end of your document's body, depending on browsers you need to support or how you want your page to load. You can read more about this topic on Building the DOM faster [Mozilla Hacks].

Single widget per page

Currently, there can only be one widget on a page at once. You can work with this limitation by programmaticaly adding/removing widgets on the DOM when desired.

Adding a user prompt

The widget incorporates no prompt as-is since it explicitly informs the user of its purpose and can be deactivated by simply leaving the page. You can choose to display a prompt to the user by running or inserting the widget on the page after an action. Here is bare-bones example that achieves this:

<button onclick="document.getElementById('goblin-script').src='https://cdn.goblincompute.com/v0/widget.js';this.remove()">
  Compute for content
<div class="goblin-widget" data-token="YOUR_TOKEN_HERE" data-path="CONTENT/PATH/AFTER/SECRET/URL.partial.html"></div>
<script id="goblin-script"></script>

Delivery characteristics

Chunk size (the size of each piece of content loading) and compute difficulty are currently fixed to numbers that make sense for most HTML content. We are working on offering customization options in the near future.