Pixie: IPFS integration, PHP-PM Server and Smart Browser Caching.
About the Project
Pixie is a simple, effective and smart image proxy for Steem blockchain applications.
Repository
https://github.com/blocker-solutions/pixie
Pull Request for the Contribution
New Features
This contribution introduces IPFS integration, PHP-PM server for easy server-load and Smart browser caching hints.
IPFS Integration
Every image parsed by Pixie now is also stored on IPFS, meaning IPFS servers both as a caching layer and redundant URLs for the parsed images.
PHP-PM
Nginx was replaced with PHP-PM, a pure PHP process manager and web server.
PHP-PM enables lowering the resources consumed by PHP, meaning a huge amount of images can be proxied in parallel with modest server hardware.
Smart Browser Caching Hints
Since IPFS is now integated, when a given URL is proxied and added to IPFS, the response contains the following headers:
content-location
Content location provides the alternative direct IPFS URL for loading the same image, on applications that use a fetch API this header can be used as fallback.
Example: https://ipfs.blocker.press/ipfs/QmRyo61SD3Zk2rxsPhTtrX1cjfBZmCUAnFN6PSsoLQAbeR
etag
The eTag header contains the IPFS hash for the proxied image, effectively working as caching helper for the server.
When a request hits the server, if previously proxied, that header will be sent back to the server by the browser, and the server can just return a 304 (not-modified) response.
Notice this rule is evaluated on the server by the expiration also, meaning the server will return fresh content after a sensitive caching period.
Also notice, that 304 responses do not include a content body, they just confirm the content on the browser cache is still valid.
Example: W/"QmRyo61SD3Zk2rxsPhTtrX1cjfBZmCUAnFN6PSsoLQAbeR"
link
This header contains the same URL on the content-location header, but for pre-fetching purposes.
Take a look on the example:
<https://ipfs.blocker.press/ipfs/QmRyo61SD3Zk2rxsPhTtrX1cjfBZmCUAnFN6PSsoLQAbeR>; rel=preload; as=image; crossorigin
This header actually tells the browser to preload the IPFS URL after receiving the content, this creates a cache on the browser on both Pixie URL and IPFS URL, meaning any of those that later be hit, will already be present on browser.
Also, this would allow caching 302 redirects to IFPS links.
GitHub Account
Leave Pixie: IPFS integration, PHP-PM Server and Smart Browser Caching. to:
Read more #utopian-io posts
Best Posts From Diego Hernandes
We have not curated any of hernandev's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Diego Hernandes
- Testing contribution one
- testing contribution testing ok ok ok
- testing title testing again
- testing title
- Pixie: IPFS integration, PHP-PM Server and Smart Browser Caching.
- Markdown-It Plugins: Proxy Image & Mixed HTML Fixer
- [codecasts/ambientum] Performance Improvements & Refactoring
- Pixie: Image/Avatar Proxy for Steem Applications.
- Steem-Verifier: Easy transaction signature verification.
- Invalid SBD unit for transfers
- [php-sodium] Bindings for detached AEAD functions
- [PHP Extension] Zodium: A libsodium OOP wrapper.
- LaravelAEAD: Advanced Encryption with Associated Data (XChacha20-Poly1305-IETF and others)
- PHP OAuth Client for SteemConnect - Token Refresh and Token Encoding/Decoding
- SteemContext: Save time switching Steem apps with this Chrome Extension!
- PHP Steem Apps with Steem Connect and Laravel - Part II: Steem Configuration and Service Provider
- PHP Steem Apps with Steem Connect and Laravel - Part I: Initial Setup
- PHP-ALPINE: Base Images; Mailparse and secp256k1 Support.
- PHP-ALPINE: Package conflicts and extension fixes.
- SteemConnect SDK for PHP [RC1] - 100% Unit Test Coverage