Robin Sheat wrote: > On Wednesday 01 July 2009 14:14:36 Greg wrote: >> The main question would be in terms of how to detect file changes >> without a full transfer - HTTP does provide some mechanisms for >> checking this, but I'm not sure if they would be adequate if scripting >> responses through HTTP... > > I use S3 as a file source for my larger files, it allows contents to be > verified by MD5. My code for this is available here: > https://code.launchpad.net/~eythian/+junk/ec2facts > it's pretty basic, but gets the job done. > > I mention this because a similar approach should be usable when backing with > HTTP and Apache. You could either do a HEAD request with 'If-Modified-Since', > and ensure that when you save the file, you update the file timestamp to that > supplied by apache, or check to see if apache will provide the MD5 (or > whatever) hash of the file contents. If the HEAD request indicates that there > is an updated version, then you pull it down using wget or similar.
The two classical approaches to this are either properly configured ETag support or using the checksum as part of the filename and never refetch a file unless its filename has changed. Regards, DavidS --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
