Skip to content

Skynet Custom Headers

Peter-Jan Brone requested to merge pj/skynet-metrics into master

MERGE REQUEST

MR Guidelines

Overview

This MR adds a couple of custom headers that will aid us in tracking some of the Skynet metrics more easily. For now, I have added the following custom headers:

  • Skynet-Is-Skapp
  • Skynet-Media-Type
  • Skynet-Skylink

Skynet-Is-Skapp
Returns whether or not we consider the Skylink to be a Skapp. This is true as soon as the Skyfile holds an HTML file. This definition might change over time as required, but for the time being, this will suffice to make a distinction between plain content and applications.

Skynet-Media-Type
Returns the top-level part of the "Media Type", which we can use to visualize the most popular content on Skynet. Please see https://en.wikipedia.org/wiki/Media_type and TestParseMediaType to see what is returned in that header.

Skynet-Skylink Returns the Skylink, this is useful because it eliminates the need to squash based on the URL. For the small price of a couple of bytes in the response header, we eliminate the need to strip the URL from query string parameters and subpaths. Even more so, when we have the subdomain redirects it will contain the actual Skylink, attributing those page views to the correct Skyfile.

Example for Visual Changes

N/A

Checklist

Review and complete the checklist to ensure that the MR is complete before assigned to an approver.

  • All new methods or updated methods have clear docstrings
  • Testing added or updated for new methods
  • Any new packages are added to Makefile and .gitlab-ci.yml
  • API documentation updated for API updates
  • Module README.md updated for changes to workflow
  • Issue added to Sia-UI repo for new supporting features
  • Changelog File Created

Issues Closed

N/A

Edited by Peter-Jan Brone

Merge request reports