How to have filename (using bwp_minify) be created from date modified?
-
tldr; How to modify bwp_minify function to output filename based on file’s date modified (forcing redownload).
I want the bwp_minify function to output a unique filename based on that file’s date modified, so every update to the file forces a reminify and forces the browser to redownload it, making my life easier for updating users’ caches (and helping with my testing).
This could be done by simply adding the unix timestamp to the end of the filename.
Obvious problem is that a lot of changes to that file will create a lot of cached versions (could be subjugated by clearing the cache directory every X days).
I would make this change myself (simply appending ‘filemtime($src)’ to the filename, but I’m not certain if I should be editing the ‘get_minify_src’ function or the ‘process_media_source’ function. (or if I need to edit the htaccess)
Your help would be much appreciated and this seems like it would make a great optional variable when calling the bwp_minify function.
Thanks.
- The topic ‘How to have filename (using bwp_minify) be created from date modified?’ is closed to new replies.