Andrea

Andrea

Closed

Hello, currently is possibile to flush the entire page cache of a website through api os server panel. I'd like to have the ability to delete pages by url.

Nginx uses a predictable algoritm to store cached files, it uses md5 and zones.

To allow flushing cache there are basically 2 ways:

  • use nginx-cache-purge module: this module is not part of the official Nginx repo and requires manual compilation of the module everytime Nginx changes. Alternatives are Nginx Plus ($$$) or usage of an unofficial Nginx repo.
  • custom script that purge caches: this script must be able to CRUD /etc/nginx/cache folder, and it must be protected given that it would run as privileged ploi user. The advantage of this solution is that it doesn't require Nginx modules.
  • ploi daemon: this is quite the same of #2 but better from a security pov. You create a daemon listing on its own port and this daemon is reachable only from localhost.

I imagine as MVP a php script app behind a php-fpm process that listen to a specific port and optionally allow only local connections. This script will run runs as ploi user to delete only the intended files. The script can calculate the cached file name because name of the cached files are predictable thanks to fastcgi_cache_path and fastcgi_cache_key . Nginx calculates md5 of the fastcgi_cache_key and uses the first and last letter of the md5 to define folder to use.

Dennis

Dennis

·

Hello! 👋

Thank you for taking the time to share your feature suggestion with us. While we currently don't have plans to implement this specific feature, we appreciate your input and will keep it on our radar for future consideration.

If this suggestion gains more support from our user community, we'll certainly revisit the idea. In the meantime, you may find that you can achieve similar results through manual setup, if applicable to your situation.

Alternatively, if applicable, you could consider adding this request to the Ploi roadmap.

Thanks again for your contribution to our ongoing efforts to improve Ploi!

no votes yet

Purge fcgi cache per page basis

2 total votes
Pedro Andrea
  • Dennis moved item to board Closed

    8 months ago
  • Dennis moved item to board Under review

    1 year ago
  • Andrea moved item to project Server Level Requests

    1 year ago
  • Andrea created the item

    1 year ago