ladjs / express-cdn

:cloud: Node module for delivering optimized, minified, mangled, gzipped assets with Express and Amazon's CDN (S3/CloudFront)
MIT License
660 stars 104 forks source link

Files not versioning correctly #56

Closed Nevtep closed 10 years ago

Nevtep commented 10 years ago

I'm seeing old versions of my js assets served from cloudfront and files in S3 don't have timestamps on their names anymore. S3 has the latest version thou cloudfront delivers old ones.

Any idea what could I be doing wrong? this is my config:

cdnOptions = { publicDir: path.join(dirname, 'public') , viewsDir: path.join(dirname, 'lib') , domain: process.env.CDNHOST , bucket: process.env.S3BUCKET , key: process.env.AWSKEY , secret: process.env.AWSSECRET , hostname: 'staging.farmshares.com' , port: 80 , ssl: false , production: false , logger: winston.info };

niftylettuce commented 10 years ago

any luck?

niftylettuce commented 10 years ago

@Nevtep let me know!

Nevtep commented 10 years ago

Nope... just re-enabled cdn doing some tests... I cleared S3 before doing that ad everything seems updated... did cloudfront changed the way to lookup cached versions? files uploaded still don't have timestamps on their names

Nevtep commented 10 years ago

Nick still no timestamp on files, old versions appearing on cloudfront, any info that would help you know what's wrong?

Nevtep commented 10 years ago

Ok so, the filename?cache=timestamp sintax is not working for me, cloudfront is not returning the correct assets, in lines 118/125 you call createTag with a filename that is commented out to have the timestamp and use this ?cache=timestamp sintax, in the process assets method lines 460 and 468 are commented out to not include the timestamp on the names.

Is there anything about cloudfront config I should be doing to serve files correctly? it's serving old file versions for some reason.

Thanks

Nevtep commented 10 years ago

Ok found it!

that should be YES since we are sending the cache timestamp on the query string

This is closed but you should update your documentation

niftylettuce commented 10 years ago

@Nevtep amazing find. you ROCK

Nevtep commented 10 years ago

@niftylettuce Thank you for this cool lib :)