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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

My 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

mikeytown2’s picture

I would make it a sub module

acbramley’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Bumping 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.

acbramley’s picture

Status: Active » Needs review
FileSize
956 bytes

This is an untested stab at this functionality, will report with testing outcome shortly.

acbramley’s picture

Above 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.

acbramley’s picture

Title: Support for static files like (profile)images expiration » Support for expiring managed files on update
Spleshka’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Needs work

Please, re-roll your patch and provide some UI settings for 7.x-2.x branch. I will glandy apply it.

acbramley’s picture

Status: Needs work » Needs review
FileSize
4.21 KB

Awesome, I like where the new branch is going, much nicer structure :) Here's the patch

acbramley’s picture

Woops, patch didn't include .inc file

Spleshka’s picture

Status: Needs review » Fixed

Great! I've made some minor changed in the patch and commited/pushed it to 7.x-2.x. Thanks a lot for patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.