Socket
Socket
Sign inDemoInstall

@datagraphics/delivery

Package Overview
Dependencies
56
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

0.6.0

Diff

Changelog

Source

[0.6.0] - 2020-06-18

Added

  • Delivery can now be passed a shouldBeCached function to customize the logic that selects files to receive long-lived cache headers. This function is passed a single parameter — the input file path — and should return true or false.
  • .topojson files will now get the content header of application/json thanks to a custom type addition to mime.

Changed

  • Delivery now uses mime instead of mime-types. It's smaller and makes it easy to add custom types.
  • Delivery now does MD5 hashing in-house — no patience for hasha's breaking changes in a minor release.
  • maxAgeOverride is now cacheControlOverride and expects you to provide the full string, not just the seconds for max-age=.
  • The logic for what gets a long-lived cache header is no longer entirely based on content type and instead decided by whether a file shows signs of being hashed. By default this is a regular expression check looking for an eight-character hexadecimal hash in the filename. Filenames that pass this test will receive a public, max-age=31536000, immutable value. Files that match the text/html content type will instead get an explicit no-cache header. Files that do not pass either test get nothing and are at the mercy of upstream decisions.
rdm
published 0.5.0 •

Changelog

Source

[0.5.0] - 2020-06-16

Added

  • Added the ability to pass a maxAgeOverride parameter to uploadFile and uploadFiles. If shouldCache is true and maxAgeOverride is provided, the upload functions will use this value instead to set the cache control header.
rdm
published 0.4.0 •

Changelog

Source

[0.4.0] - 2020-01-26

Added

  • Added flag for using the Accelerate endpoint with S3. useAccelerateEndpoint can now be passed when initializing the Delivery class. It will depend on the S3 bucket already having it active, however.
rdm
published 0.3.0 •

Changelog

Source

[0.3.0] - 2020-01-16

Added

  • Video files (.mp4, .webm) now receive cache headers.
rdm
published 0.2.0 •

Changelog

Source

[0.2.0] - 2019-12-06

Added

  • Font files (.woff2, .woff, .ttf, .otf) now receive cache headers.

Changed

  • JSON files are now cached for one hour.
  • Images are now cached for one year.
  • Minimum Node.js support is now v10. It may still work on v8, but no promises.
  • This package is now available on npm as @datagraphics/delivery instead of @datadesk/delivery, which has been deprecated.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc