Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 399412a

Browse files
ChulooGatsbyJS BotStefanNieuwenhuishashimwarren
authored
chore(blog): Add "Faster Sites with Optimized Media Assets" to blog. (gatsbyjs#20735)
* article: Added article, avatar and bio * updated links * chore: format * Update docs/blog/author.yaml Co-Authored-By: Stefan Nieuwenhuis <[email protected]> * chore: format * Change publish date to March 2nd * Add link to Gatsby Image doc * Add link to Gatsby source Cloudinary * Fix internal link Co-authored-by: GatsbyJS Bot <[email protected]> Co-authored-by: Stefan Nieuwenhuis <[email protected]> Co-authored-by: Hashim Warren <[email protected]>
1 parent 22ead19 commit 399412a

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: "Faster Sites with Optimized Media Assets"
3+
date: 2020-03-02
4+
author: William Imoh
5+
excerpt: "Introducing two new Gatsby-Cloudinary plugins for optimized media management in Gatsby apps"
6+
tags: ["media", "cloudinary", "performance", "image", "video"]
7+
---
8+
9+
Plugins are at the heart of developing software with Gatsby because they not only extend Gatsby’s robust features but also make available, data from multiple sources. I’m excited to introduce you to two Gatsby plugins: gatsby-source-cloudinary and gatsby-transformer-cloudinary.
10+
11+
Cloudinary is a cloud-based end-to-end media management platform for many of the world's top brands. With extensive product offerings from an Image management solution, Dynamic Video Platform, and a dynamic digital asset management solution.
12+
13+
## The Motivation Behind the Scenes
14+
15+
The two open-source Gatsby-Cloudinary plugins combine the best of both worlds:
16+
17+
- Gatsby builds high-performance sites with data from multiple sources and fetches declarative data with GraphQL, offering a superior developer experience and a rich ecosystem for developing in ReactJS.
18+
- Cloudinary is an advanced media-management service that offers three key features:
19+
- Optimized media storage and delivery
20+
- Media transformation on data query and on the fly with dynamic URLs
21+
- Digital-asset management for high performance
22+
23+
For example, an image uploaded to Cloudinary can be retrieved with a dynamic URL that transforms the original image into a cropped circular image, with a fixed width and height. The final URL becomes:
24+
25+
https://res.cloudinary.com/demo/image/upload/w_400,h_400,c_crop,r_max/w_200/lady.jpg
26+
27+
Several transformation parameters can be included in the URL to modify the image on the fly. You can find more about [Cloudinary here](http://bit.ly/2GbkeT3).
28+
29+
Using the Gatsby-Cloudinary plugins, optimized media assets from Cloudinary are bundled with the static files built by Gatsby. Those optimized assets can either be—
30+
31+
- Sourced directly from Cloudinary with the source plugin.
32+
- Uploaded from local storage to Cloudinary with the transformer plugin. The returned images are transformed into file nodes that are compatible for use with the robust `gatsby-image` component.
33+
34+
## gatsby-source-cloudinary Plugin
35+
36+
[gatsby-source-cloudinary](/packages/gatsby-source-cloudinary/) is a plugin that fetches media assets from Cloudinary. You must first specify the folder from which to query those assets. The plugin then transforms them into Cloudinary file nodes, which can be queried with GraphQL in a Gatsby project.
37+
38+
Before file nodes are created, Cloudinary optimizes media files queried from its platform by applying the `f_auto` and `q_auto` transformation parameters. Impressively, those parameters optimize delivery format and quality for media assets by over 70 percent.
39+
40+
## gatsby-transformer-cloudinary Plugin
41+
42+
[`gatsby-image`](/docs/using-gatsby-image/) is a React component that delivers optimized images in Gatsby apps through GraphQL queries. The gatsby-transformer-cloudinary plugin uploads local files to Cloudinary, which then creates `CloudinaryAsset` nodes that are compatible for use in `gatsby-image`. This plugin can also apply Cloudinary media transformations in the GraphQL queries for the queried media assets.
43+
44+
## Preliminary Steps
45+
46+
The plugins can be used for various JAMstack applications built with Gatsby. The core goal is to store, optimize and deliver media assets with possible transformations. To get started on using the two Gatsby-Cloudinary plugins, follow these steps:
47+
48+
1. [Create a free account on Cloudinary](http://bit.ly/2v3sy4N).
49+
2. [Create a Gatsby project](/tutorial/) with any of the Gatsby starters.
50+
3. Configure either of the plugins in the `gatsby-config.js` file.
51+
4. Refer to the [source plugin](http://bit.ly/2NHVshC) or [transformer plugin](http://bit.ly/2sMqe1u) documentation for the procedure on how to query Cloudinary images or upload and transform them with `gatsby-image`, respectively.
52+
53+
## Next in the Horizon
54+
55+
Given the ever-growing demand for speedy and usable apps and the continual feature advancements of Cloudinary and Gatsby, maintenance and capability enhancements of the plugins are ongoing.
56+
57+
Fork, clone, download, and try out the two plugins yourself. If you run into problems, create an issue in the relevant repository or send us pull requests (PRs) and be sure to check out my [blog on Cloudinary](https://cloudinary.com/blog/introducing_cloudinary_s_gatsby_plugins).

docs/blog/author.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@
376376
bio: Product Designer at Forestry.io & TinaCMS Team Member
377377
avatar: avatars/scott-byrne.jpg
378378
twitter: "@scottpbyrne"
379+
- id: William Imoh
380+
bio: Developer Advocate and Product Manager at Mart Labs
381+
avatar: avatars/william-imoh.jpg
382+
twitter: "@iChuloo"
379383
- id: Josh Comeau
380384
bio: Perpetual tinkerer, cat person. Staff software engineer on the Gatsby Cloud team.
381385
avatar: avatars/josh-comeau.jpg

docs/blog/avatars/william-imoh.jpg

1.51 MB
Loading

0 commit comments

Comments
 (0)