Welcome! Log In Create A New Profile

Advanced

Using request URI path to store cached files instead of MD5 hash-based path

October 05, 2017 07:29AM
Hi,

If proxy caching is enabled, NGINX is saving the files under subdirectories of the proxy_cache_path, based on the MD5 hash of the cache-key and the levels parameter value.

Is it possible to change this behaviour through configuration to cache the files using the request URI path itself, say, under the host-name directory under the proxy_cache_path.

For example, if the proxy_cache_path is /tmp/cache1 and the request is http://www.example.com/movies/file1.mp4, then can the file get cached as /tmp/cache1/www.example.com/movies/file1.mp4

I think such a direct way of defining cached file paths would help in finding or locating specific content in cache. Also, it would be helpful in purging content from cache, even using wild-carded expressions.

However, I seem to be missing the key benefit of why files are stored based on MD5 hash based paths.

Could someone explain the reason for using MD5 hash based file paths?

Also, with vanilla-NGINX, if there is no configurable way to use direct request URI paths, is there any external module which could help me to get this functionality?

Thanks
Rajesh
Subject Author Posted

Using request URI path to store cached files instead of MD5 hash-based path

rnmx18 October 05, 2017 07:29AM

Re: Using request URI path to store cached files instead of MD5 hash-based path

Lucas Rolff October 06, 2017 09:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready