stacks-archive / app.co

The universal dapp store
https://app.co
39 stars 19 forks source link

Cache logos for apps with fallback pixel served upon error #90

Closed markmhendrickson closed 6 years ago

markmhendrickson commented 6 years ago

Possibly using https://www.imgix.com/

If image can't be loaded by the cache for whatever reason, a single transparent pixel custom image should be shown. For example, imgix has these options:

screen shot 2018-08-21 at 14 01 27

Also tackle needs raised in https://github.com/blockstack/app.co/issues/145 and https://github.com/blockstack/app.co/issues/195 as part of implementation.

aulneau commented 6 years ago

This is still an open issue. I think we should 100% use imgix, it's a great service. I think in order to do that, we still need to initially download all of the app icons and have them stored at a central location, eg images.app.co so that we can set up a proxy to it via imgix. Currently they are all coming from many different sources, and as such we cannot proxy them.

We can write a script that will crawl them all and then save them as app-icon${app.name}-${width}x${height}.${ext} etc. cc @hstove

markmhendrickson commented 6 years ago

I believe that we can have imgix pull the original assets directly from their third-party sources and then cache them for us instead of loading them to a single domain first. @aulneau are you sure about that limitation?

aulneau commented 6 years ago

@markmhx We have a google cloud bucket set up to be proxied at appco.imgix.net already. We can do a webproxy -> https://docs.imgix.com/setup/creating-sources/web-proxy but that would require additional time to set up and get everything signing correctly. I am not sure if there is a programatic way to automatically sign images, I only see a way to manually add image URLs. I also don't know if the images will then persist even after the original source removes them.

markmhendrickson commented 6 years ago

I see, I think you're right then – imgix seems to demand manual URL identification and signing for any images pulled directly from outside of our own domains. I'm cool with caching images first then having imgix distribute them – perhaps the caching should take place upon app submission? And for legacy apps, we can run a script?

hstove commented 6 years ago

That's exactly the plan for #121

markmhendrickson commented 6 years ago

Ah is this issue redundant with that one?