Activelink

Stephen Oliver edited this page Mar 30, 2017 · 2 revisions
Clone this wiki locally

A small PNG image that is part of a Freesite, used when linking to another site. It is a simple form of prefetching.

When a user loads a page with an Activelink on it, loading the Activelink image causes FProxy to fetch the container which holds it.

This means that by the time the user clicks on the Activelink, the load time for the Activelink'd site will be dramatically reduced compared to a normal text link.

Format

An Activelink image should be a PNG image file named activelink.png, with the following dimensions:

  • Width: 108 pixels

  • Height: 36 pixels

You can create an Activelink from any image using imagemagick. The following is an optimized command (you might want to change the background color):

convert example.png -background white -alpha remove -flatten -alpha off -resize 108x36^\> -liquid-rescale 108x36^ -liquid-rescale 108x36\!  -strip  -quality 95  PNG8:activelink.png

Adding an Activelink image to your own freesite

Your Activelink image file should be located in the root of your site.

The URI for it would be similar to:

USK@<crypto>/sitename/0/activelink.png

You should also make sure that it resides in the main container file for the site.

You can verify that your Activelink is set up properly using the KeyUtils plugin. Use the plugin to explore the URI for your site. All the files in your site will be listed.

It should look something like this:

0-0 [c] AIR / text/html /index.html
0-0 [c] AIR /activelink.png image/png /activelink.png

The [c] means that the files are stored in the container. Both your html files and activelink.png file should be in the container.

For a small site, all your files should be in the container. For a large site, some images and other media should not be in the container, as the container has a size limit.

Linking to other freesites

When linking to a site, check to see whether it has an Activelink.

If so, it is frequently wise to use it as the link text. Be sure to keep the USK edition in your link up-to-date when updating your own freesite.

Technical details

Using Activelinks on a freesite has several effects.

First, since the activelink is in the main container file for the site, loading the activelink causes the user's node to also load all the html for the site (prefetching). This means that when they follow the link, their node doesn't have to fetch any data from the network.

Second, it means that the container file is more widely available, not all visitors to your site will click on all links to other sites, but they will all load Activelink images from other sites that you use on your page.

As a result, those sites' container files are more popular and therefore better distributed through the network, making them load faster.

And lastly, when browsing a freesite, the users node will start checking for updates to the freesite by looking for newer editions of the Updatable Subspace Key.