Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Idea taken from #1075526: Upstream CDN support?:
Would be usefull to have some way to expire URLs of static files like:
- profile images
- file api files (would include image fields)
- image derivatives like thumbnails etc
- javascript/css files
This would make expire more suitable to work with a cdn like cloudfront, akamai etc.
Comment | File | Size | Author |
---|---|---|---|
#9 | 1082860-expire-file-url-4.patch | 6.3 KB | acbramley |
#8 | 1082860-expire-file-url-3.patch | 4.21 KB | acbramley |
#5 | 1082860-expire-file-url-2.patch | 1.03 KB | acbramley |
#4 | 1082860-expire-file-url-1.patch | 956 bytes | acbramley |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedMy thoughts:
- Aggregated js/css files is taken care of by http://drupal.org/project/advagg - One could make a sub module to handle all css/js files; even those not aggregated by placing a single file into its own bundle.
- Image derivatives could be done with this http://groups.drupal.org/node/127079
- File api - doesn't it append _0 to the file if you upload the same filename?
- profile images... there's a reason this is not in D7 core.
But looking over that issue and expire seems to be the right place for it. Go for it!
You might be able to get some pointers from my other module for caching image info
http://drupal.org/project/imageinfo_cache
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedI would make it a sub module
Comment #3
acbramley CreditAttribution: acbramley commentedBumping this to 7.x-1.x as this would be great for expiring file urls when (for example) you update a file using the Media module. I have run into issues with this on a production site where clients were updating files and the old file was staying cached in Varnish for a long time. I'm going to begin looking into this now.
Comment #4
acbramley CreditAttribution: acbramley commentedThis is an untested stab at this functionality, will report with testing outcome shortly.
Comment #5
acbramley CreditAttribution: acbramley commentedAbove patch doesn't work as I had the base path in the url being passed in. This new patch seems to work well, I've tested updating a file and see it correctly being purged from Varnish.
Comment #6
acbramley CreditAttribution: acbramley commentedComment #7
SpleshkaPlease, re-roll your patch and provide some UI settings for 7.x-2.x branch. I will glandy apply it.
Comment #8
acbramley CreditAttribution: acbramley commentedAwesome, I like where the new branch is going, much nicer structure :) Here's the patch
Comment #9
acbramley CreditAttribution: acbramley commentedWoops, patch didn't include .inc file
Comment #10
SpleshkaGreat! I've made some minor changed in the patch and commited/pushed it to 7.x-2.x. Thanks a lot for patch.