流量站日志
https://medium.com/nona-web/converting-images-to-webp-from-cdn-9433b56a3d52
1. Listen for requests to CDN, and trigger a Lambda function that hijacks any viewer request.
2. Determine if the request event is for an image and if the browser requesting the resource supports WebP based on the user-agent we receive from the request.
3. If we determine that the request is for an image and that the browser supports WebP, we replace it with therequest uri image extension with .webp and add the original extension into the request header
4. Next, we trigger a separate Lambda that hijacks any CDN origin response.
5. If the request uri on the response event has a .webp extension, and the response status is a 404, we check our S3 bucket for the same image, but with the original extension, we placed into our request header in step 3.
6. If we find an image with the original extension in S3, we run a WebP conversion using Sharp and place it in the origin response, otherwise, we leave the 404 response unaltered.
2. Determine if the request event is for an image and if the browser requesting the resource supports WebP based on the user-agent we receive from the request.
3. If we determine that the request is for an image and that the browser supports WebP, we replace it with therequest uri image extension with .webp and add the original extension into the request header
4. Next, we trigger a separate Lambda that hijacks any CDN origin response.
5. If the request uri on the response event has a .webp extension, and the response status is a 404, we check our S3 bucket for the same image, but with the original extension, we placed into our request header in step 3.
6. If we find an image with the original extension in S3, we run a WebP conversion using Sharp and place it in the origin response, otherwise, we leave the 404 response unaltered.
流量站日志
1. Listen for requests to CDN, and trigger a Lambda function that hijacks any viewer request. 2. Determine if the request event is for an image and if the browser requesting the resource supports WebP based on the user-agent we receive from the request. 3.…
aws lambda edge查看器请求大小不能超过1MB,而源响应却可以很大,所以在打包的时候尤其注意不要将node module打包到查看器请求zip包中(这个大坑花了半天时间)
流量站日志
aws lambda edge查看器请求大小不能超过1MB,而源响应却可以很大,所以在打包的时候尤其注意不要将node module打包到查看器请求zip包中(这个大坑花了半天时间)
aws与s3的权限配置也很重要,删除lambda@edege函数也需要在cloudfront里取消关联后才能删除,耗时几小时才能生效
https://github.com/bmpi-dev/aws-lambda-edge-img2webp AWS Lambda@Edge自动转换图片服务终于搞完了,花了两天时间,调试真是个痛苦的过程。。
GitHub
bmpi-dev/aws-lambda-edge-img2webp
Contribute to bmpi-dev/aws-lambda-edge-img2webp development by creating an account on GitHub.
流量站日志
https://bloggingwizard.com/push-notifications/
浏览器通知🆚邮件订阅,前者比后者ROI高2-10倍,博客可以考虑优先支持浏览器通知
流量站日志
浏览器通知🆚邮件订阅,前者比后者ROI高2-10倍,博客可以考虑优先支持浏览器通知
GitHub
Feature request : web push notifications · Issue #387 · LouisBarranqueiro/hexo-theme-tranquilpeak
What about having something like push notifications, when a new article or something is being posted by someone .then a push notification is being send. There are many services for this
流量站日志
https://github.com/LouisBarranqueiro/hexo-theme-tranquilpeak/issues/387
You will need a server (or service) in the middle. Remember that Hexo just generate static site and there is no "action" beyond HTML transfer from the server where you host your site. That being said, one alternative you can try is to design a deployment plugin for hexo that actually send a message through a push service API. That would be simple to accomplish and your readers only have to subscribe to that push service (ie. Google Cloud Message, NMA, etc).
Other option: AWS SNS can be used to implement a push service and/or/mixed email/sms messaging. You will have to setup a queue, push to it on hexo deploy, and design a interface that can subscribe your readers to a list of recipients. I never used it as push service but I do use it to notify me after a success/failure hexo generate on travis-ci. This is paid option and I know there are other suppliers already prepared as push service, you just need use their API.
IFTTT integration: Use your RSS feed on a IFTTT applet to trigger a push notification through one of the available services (like notify my droid, etc).
Other idea: Telegram Channel and a ChatBot (switch Telegram for: skype, facebook messenger, slack or other way a "chatBot" can push messages to). I use this to be notified by my homeTheather system when a new episode of my favorite TV Show is available. To accomplish this I wrote a microservice that receive a HTTP request and send it as message to me (or family group chat in my case) through a Telegram ChatBot. Telegram offers a thing called Channel, it is like a whatzapp group chat but only Channel owner can write message while all other members can just receive that message. (very similar to a Push notification). The microservice I wrote is way too simple written (badly) in NodeJS, runs for free on Hook.io but could be run on AWS Lambda or Google Cloud Function, App Engine, Heroku or any other, few modifications needed.
Based on the microservice idea above and a mix of push service or IFTTT I think it should be pretty simple to have a deploy plugin for hexo where the deploy action is a simple API call or a HTTP request to specified URL and PUSH messages would be sent way. The worst part, IMHO, would be to elect a push service free for the subscribers (your reader) and with no need to install apps (many would no use if they have to install a new app just because of you).
Other option: AWS SNS can be used to implement a push service and/or/mixed email/sms messaging. You will have to setup a queue, push to it on hexo deploy, and design a interface that can subscribe your readers to a list of recipients. I never used it as push service but I do use it to notify me after a success/failure hexo generate on travis-ci. This is paid option and I know there are other suppliers already prepared as push service, you just need use their API.
IFTTT integration: Use your RSS feed on a IFTTT applet to trigger a push notification through one of the available services (like notify my droid, etc).
Other idea: Telegram Channel and a ChatBot (switch Telegram for: skype, facebook messenger, slack or other way a "chatBot" can push messages to). I use this to be notified by my homeTheather system when a new episode of my favorite TV Show is available. To accomplish this I wrote a microservice that receive a HTTP request and send it as message to me (or family group chat in my case) through a Telegram ChatBot. Telegram offers a thing called Channel, it is like a whatzapp group chat but only Channel owner can write message while all other members can just receive that message. (very similar to a Push notification). The microservice I wrote is way too simple written (badly) in NodeJS, runs for free on Hook.io but could be run on AWS Lambda or Google Cloud Function, App Engine, Heroku or any other, few modifications needed.
Based on the microservice idea above and a mix of push service or IFTTT I think it should be pretty simple to have a deploy plugin for hexo where the deploy action is a simple API call or a HTTP request to specified URL and PUSH messages would be sent way. The worst part, IMHO, would be to elect a push service free for the subscribers (your reader) and with no need to install apps (many would no use if they have to install a new app just because of you).
Notifymyandroid
Vilcabamba Online
Information, recommendations, and facts about Vilcabamba, Ecuador
流量站日志
You will need a server (or service) in the middle. Remember that Hexo just generate static site and there is no "action" beyond HTML transfer from the server where you host your site. That being said, one alternative you can try is to design a deployment plugin…
Humanwhocodes
Detecting new posts with Jekyll and Netlify
This blog has long featured the ability to subscribe by email, so you could get an email notification when a new post was published. I’ve used various services over the years to achieve...
https://docs.netlify.com/functions/configure-and-deploy/#configure-the-functions-folder Netlify集成AWS Lambda without an AWS account
Netlify
Configure and deploy functions
Netlify builds, deploys, and hosts your frontend.
Learn how to get started, find examples, and access documentation for the modern web platform.
Learn how to get started, find examples, and access documentation for the modern web platform.
流量站日志
https://humanwhocodes.com/blog/2018/09/detecting-new-post-jekyll-netlify/
https://www.shareapi.com/ 通过判断线上最新的Post ID与本地最新的Post ID是否相同,如果不同就在Netlify部署时自动发送浏览器通知和社交网络分享
Shareaholic
Universal Share API - Developer Tools - Shareaholic
Use the Universal Share API to share content to 200+ supported destinations.
流量站日志
https://www.webpushnotifications.com/
Web Push服务大多是收费的,还不便宜,自己搭建又需要集成数据库,比较麻烦啊,不知道AWS有啥好方案没
流量站日志
Web Push服务大多是收费的,还不便宜,自己搭建又需要集成数据库,比较麻烦啊,不知道AWS有啥好方案没
webpushr.com 最终使用了这个推送服务,免费版有5万个月推送设备额度,还不错,不过调试netlify耗时几小时。。。心累,文档太点差了
流量站日志
user->browser->js check ua->aws lambda->s3 这种方案应该便宜一些
最便宜的方案就是用GitHub存储图片(单个不超过100MB),然后使用netlify免费cdn传输,还可以免费通过netlify使用aws的lambda了,0成本,等AWS收费了我就考虑往这种方案迁移