Open fmbiete opened 9 years ago
This might solve #24
@fmbiete Thanks for your work, this patch is exactly what I needed ! It's one of the most interesting features of nginx plus cache IMO.
@PiotrSikora Can we have a word from the developer on this please ? Because according to https://github.com/FRiCKLE/ngx_cache_purge/blob/master/TODO.md , prefixed purges are "impossible". It would be amazing to have this officially included in the extension :)
yes please @PiotrSikora I also need this !
@fmbiete I just compiled your fork and it does not work with nginx 1.9.5, I had crashes when I tried to make a simple purge (single page). I had no time to test more but I'll do it maybe later.
@fmbiete thanks for your work, but this is far from useable (it doesn't invalidate items in cache, it doesn't look that it would work with AIO, and most importantly, it would block worker process for the time it needs to walk all the directories and read the files - which in pessimistic case can be as long as 1s for cache with as little as 100 files).
@PiotrSikora Hello ! When you say it's impossible with the current implementation, can you explain why ? It could help us if we want to improve this plugin.
@PiotrSikora
It doesn't invalidate items in cache
Since the file corresponding to the cached item will not exist anymore nginx will invalidate the item. It's far from perfect, and I would love to find an alternative.
it would block worker process
Of course, it will block the thread of the worker running the request, not the whole worker.
for the time it needs to walk all the directories and read the files
This should be used with the cache folder in RAM disks, and there this time will be almost zero. I believe it's not really intelligent to put the cache in disk. Your web content should already be on disk, so disk cache will give you 0 improvements...
It's very hard to purge some pic that has some relationship, like a.jpg , a/480x360.jpg, a/20x60.jpg and more. We can only purge every pic one by one.
Please inform me if one day can be purge by pattern match.Thanks!
This cause nginx worker exited when config as separate location, event purge without '*'. Test under v1.12.2
This pull includes #33, but each one is only a commit so it should be quite easy to cherry-pick. Sorry about that.
Adds support to partial keys.
When using complexes key_cache or when you need to purge the cache of more than one page, you will miss the option of using wildcards.
Here, we support willcards in the URI:
Example of use:
Put an '*' at the end of your purge cache URL.
This will remove every cached page whose key cache starting with:
Be careful not passing any value for the values after the $uri, or put it at the end of your cache key.
As in the other pull request, feel free to improve or suggest improvements :wink: