summaryrefslogtreecommitdiff
path: root/installation
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-01-21 14:20:13 -0600
committerMark Felder <feld@feld.me>2021-01-21 14:20:13 -0600
commit003402df401f2bbf46e47017e3b7a2ec27615ea2 (patch)
tree61b8f4d9a71fee4100f7955ca55c6141eae38666 /installation
parent3078e62488ad1d94d1d3b83faf9f2b070e4aff06 (diff)
Add ability to invalidate cache entries for Apache
Diffstat (limited to 'installation')
-rwxr-xr-xinstallation/apache-cache-purge.sh.example25
1 files changed, 25 insertions, 0 deletions
diff --git a/installation/apache-cache-purge.sh.example b/installation/apache-cache-purge.sh.example
new file mode 100755
index 000000000..be1d36841
--- /dev/null
+++ b/installation/apache-cache-purge.sh.example
@@ -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 "$@"