Closed hausen1012 closed 1 month ago
Thank you very much for developing such a user-friendly program
I use the favicon downloader as a way to obtain navigation website icons, but I have three questions when using it.
- Due to my navigation website having a large collection of websites, icon display is very slow when there are a large number of requests
I personally think that this can be done using caching. When a favicon downloader requests an icon, it will cache the icon locally, wait for the next request, and return directly. Of course, this cache also has a time limit, such as setting how many days it will be automatically cleared.
- I hope to add a request method that carries suffixes
For example https://favicon.153224.xyz/favicon/www.amjun.com When this request https://favicon.153224.xyz/favicon/www.amjun.com.png It can also respond correctly, so that when the first request is initiated and the browser requests again later, there will be cache, so there is no need to request the server. Of course, this can actually be solved through nginx configuration.
- When my website is an internal IP address, I cannot obtain the icon
Even though I knew it was normal to not be able to obtain it, at that time I thought it was possible to return a default icon?
I'm not sure if some of the above issues can be resolved. Looking forward to your reply
Images are recommended to use lazy loading, and images are loaded to ensure speed, it is recommended to use the https://github.com/seadfeng/favicons-proxy repository, directly copy the code to workers deployment can be, this version does not use web scraper, just proxy, so the speed is very fast.
Want to cache images to the server, please solve the problem by yourself, this tool mainly runs on cloudflare pages, edge function is not support image storage, need additional S3 storage to support ;
However, running in docker nodejs does not have this limitation, you can expand according to demand
I understand, thank you
Even if it cannot be stored, I still think there are two requests to see if they can be added.
Even if it cannot be stored, I still think there are two requests to see if they can be added.
- Requests can be made by adding a suffix. Like https://api.iowen.cn/favicon/www.amjun.com.png This request, check if it has a png suffix, remove the suffix before requesting the website icon
- When the requested domain name is invalid, return the default image instead of 400 For example, when there is an internal network address in the navigation, there will be no request failure
1.source image may be gif, jpg or others, So using png as a suffix is not appropriate .
ok,Can special treatment be given to these suffixes?
ok,Can special treatment be given to these suffixes?
https://github.com/seadfeng/favicon-downloader/blob/rewrites/next.config.mjs
Try changing it like this.
{
source: '/favicon/:domain((?:[a-z0-9-]+\\.)+[a-z0-9]{1,}).png',
destination: '/favicon/:domain',
}
ok,Can special treatment be given to these suffixes?
https://github.com/seadfeng/favicon-downloader/blob/rewrites/next.config.mjs
Try changing it like this.
{ source: '/favicon/:domain((?:[a-z0-9-]+\\.)+[a-z0-9]{1,}).png', destination: '/favicon/:domain', }
thanks
Thank you very much for developing such a user-friendly program
I use the favicon downloader as a way to obtain navigation website icons, but I have three questions when using it.
I personally think that this can be done using caching. When a favicon downloader requests an icon, it will cache the icon locally, wait for the next request, and return directly. Of course, this cache also has a time limit, such as setting how many days it will be automatically cleared.
For example https://favicon.153224.xyz/favicon/www.amjun.com When this request https://favicon.153224.xyz/favicon/www.amjun.com.png It can also respond correctly, so that when the first request is initiated and the browser requests again later, there will be cache, so there is no need to request the server. Of course, this can actually be solved through nginx configuration.
Even though I knew it was normal to not be able to obtain it, at that time I thought it was possible to return a default icon?
I'm not sure if some of the above issues can be resolved. Looking forward to your reply