Cloudflare implements IPFS Gateway to support distributed web hosting and serving
Currently, when a user tries to access a website from their browser, their computer will basically track down and send a request to a server wherever the server may be located around the world. The server will receive the request and respond by sending back the content requested to the requester.
But what happens when the server is unavailable for some reason, may be as a result of natural disasters or say the owner decides to take it down? The content is unavailable. That's the downside of centralization of hosting and in regard to the Internet as we know it. The InterPlanetary File System (IFS) that embraces the content decentralization idea aims at changing that by embracing a new decentralized version of the web.
The system will make it possible for any content to be available even when one server is down for some reason. First, data or information and websites are cached and hosted by nodes on a distributed network of computers from all around the world. Basically, content hosted on an IPFS can be accessed by a web user downloading a node or using a third party IPFS gateway that serves the web user the requested content via a web browser without the web user having to download any software on their computer. Cloudflare have implemented an IPFS gateway that can allow users to not only access content hosted on IPFS but also to build website hosted entirely on IPFS.
To explain further, IPFS is basically a peer-to-peer file system comprising of a network of thousands of computers around the world, with each computer storing network on behalf of the network. With IPFS, anyone can sign up to cache and serve content for free to web users instead of web users relying on the being served only by hosting providers as it is currently. Usually, if you want to have your content hosted by a hosting company, you pay the company and submit your website and data to be hosted and served as may be needed. However, with the IPFS, computers on the network -- typically known as nodes -- can sign up to start storing and serving data regardless on the devices they are using.
The node simply downloads the IPFS onto their computer in order to access the content. However, this is one way of accessing the content. The second method is to use IPFS gateways where you do not need to download the IPFS to access the content. The IPFS gateways are third-party nodes that fetch content from the IPFS network and serve it to you over the HTTPS. The user will only need to open a browser and type in the gateway's name (website address) and hash of the content they are looking for and the gateway responds by serving the content on the browser.
Here's where this CloudFlare IPFS gateway comes in. Currently, the Cloudflare gateway can be used without having to download any software. It can allow anyone to access the 5,000,000,000 files already uploaded to the IPFS. Apart from accessing the content on the IPFS, the Cloudflare gateway allows you to build website that is hosted entirely on the IPFS but the website will still be available to your users at a custom domain name. The company says it will issue any website connected to their gateway a free SSL certificate to secure the connection of the website to the gateway, against snooping and manipulation.
The Cloudflare gateway works as a cache in front of IPFS. To use the gateway, you will basically need a browser connected to the internet, and the address of something on IPFS that you want to view. Simply open your browser and type the name of their gateway, which is "cloudflare-ipfs.com", followed by the file path that reads /ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco, in which the "ipfs" points the gateway to the address of the content which you want to access, and the address of that content is QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco.
Distributed web hosting and serving may present several advantages, for instance, the ability to host and serve content from multiple types of devices and the fact that it reduces strain on networks.
Data stored in a distributed web hosting system would also be requested by its hash value on a block, instead of its IP address as is currently. And because the content containing a particular hash can be cached and stored on multiple nodes on the network, if one node that was catching and storing it goes offline, the network will look for the same content in a different node. So the content is still available. No more "content is unavailable" due to server errors.
And because the hash is a unique fingerprint for a given file, it is less likely to receive a tampered file on request because the tampered file will return for a different hash value. Therefore, the system improves content security.
Although the IPFS supports SHA-256 basically, it can move to a different algorithm. SHA-256 makes it less possible for a collision where two files in the IPFS share an address.