I have a basic configuration of a caching system that saves a file based on the parameters in the URL, so if this page is viewed again, it accesses a static file. for example if my url
http://www.example.com/female/?id=1
I have a file located in a folder with cache id = 1.html
female/cache/id=1.html
this is being cached for a while now, but I want it to always use the cached file if the page is not refreshing.
So, I applied the below PHP code.
<? unlink('../' . $gender . '/cache/id=' . $_POST['id'] . '.html'); ?>
this works great, but sometimes there are additional options in my url. So currently I have the following files in the cache folder
female/cache/id=1.html female/cache/id=1&type=2.html female/cache/id=1&type=3.html female/cache/id=1&type=3&extra=4.html
But when I save my content, only the woman / cache / id = 1.html is deleted.
How can I delete any file in this folder with id = 1
source share