Add ability to invalidate cache entries for Apache
This commit is contained in:
parent
3078e62488
commit
003402df40
4 changed files with 50 additions and 3 deletions
25
installation/apache-cache-purge.sh.example
Executable file
25
installation/apache-cache-purge.sh.example
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
# A simple shell script to delete a media from Apache's mod_disk_cache.
|
||||
|
||||
SCRIPTNAME=${0##*/}
|
||||
|
||||
# mod_disk_cache directory
|
||||
CACHE_DIRECTORY="/tmp/pleroma-media-cache"
|
||||
|
||||
## Removes an item via the htcacheclean utility
|
||||
## $1 - the filename, can be a pattern .
|
||||
## $2 - the cache directory.
|
||||
purge_item() {
|
||||
htcacheclean -p "${2}" "${1}"
|
||||
} # purge_item
|
||||
|
||||
purge() {
|
||||
for url in "$@"
|
||||
do
|
||||
echo "$SCRIPTNAME delete \`$url\` from cache ($CACHE_DIRECTORY)"
|
||||
purge_item "$url" $CACHE_DIRECTORY
|
||||
done
|
||||
}
|
||||
|
||||
purge "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue