Cache improvements

Request new functionality here
abc
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 04 Feb 2017, 00:38

Cache improvements

Postby abc » 04 Feb 2017, 01:07

Hello.

I have some issues with current image cache realization. Could you make it more powerful please?

1. I can't set up or disable cache expiration time without hadrcode it. Could you make a config variable for it? (Now it's like this: time() - filemtime($file) > 86400*7)
2. I can't save image with human readable filename. You fixed it in plugin, could you port it to general code? https://tt-rss.org/gitlab/fox/tt-rss/co ... 05214fa568
3. Modern irc-clients and stuff like Discord can't make a preview of image cause it doesn't look like an image url. Could you append mime-based extension to filename (like /bla/bla/ad5647fda...567adcab.png)?
3.1. Content-type is hardcoded to image/png, could you show a real mime of a file FTGJ?
3.2. Optimisation for disabled cache expiration. Could you add some subdirectories like some CMS and nginx do for cache (like '/images/' . substr($hash, 1) . substr($hash, 1, 2) . $hash)
4. Direct link to files. I'd like to show files with nginx only without touching php at all. Could you change link format for more nginx-friendly?

Thank you.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Cache improvements

Postby fox » 04 Feb 2017, 10:54

personally i think image caching is a minor feature which works fine as it is. it was never intended for someone to just download everything on the internet and keep it forever, which would be stupid and pointless. thus, current design.

now, detailed comments:

1. i don't think adding a tunable here is a good idea, config.php is bloated enough as it is. especially, because someone will definitely set it to some retarded value and then come complaining tt-rss ate all his disk space or w/e.
2, 3. this sounds reasonable and easy to add
3.1. there's nothing to be gained here because any browser is going to figure the real image by contents, and downloaders wouldn't care
3.2. no, this makes things harder to clean up for no good reason. again i'm not aiming for some kind of industrial kitty meme download factory here, you have to understand the intended scope of this feature.
4. no, tt-rss in general is not giving direct access to files in cache directories.

abc
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 04 Feb 2017, 00:38

Re: Cache improvements

Postby abc » 06 Feb 2017, 02:20

Works fine. Thank you.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Cache improvements

Postby fox » 10 Feb 2017, 12:24

this is going to change somewhat. i'm changing cache handler to set content-disposition: inline because it makes it possible to watch cached urls directly in browser without mandatory auto-saving.

the filename is still going to be there if user presses ctrl-s etc. i think it's a less annoying behavior overall for media.


Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 2 guests