matb / hexo-to-s3

Deploy your hexo site from your build server directly to S3!
0 stars 0 forks source link

upload changed files only? #1

Open yanxianghuang opened 8 years ago

yanxianghuang commented 8 years ago

It takes too many put request to uploading to aws s3, which cost lots budget.

Is that possible to include features, that only uploading new or changed files? Possibly combining with git?

matb commented 8 years ago

Can you make an example on how you produce too many requests?

I could think of an option that caches that files that have been send to a specific destination and sends only changed / new ones. But I cannot really bring git into this picture because the files that need to be send depend on the destination of the upload.

yanxianghuang commented 8 years ago

Thanks for your reply.

Yes, whenever I "hexo deploy" the working set, and then use the hexo-to-s3 to upload. The whole public folder has been uploaded to s3.

I can think of an option that each time, before upload, we can request the whole file/file_list/changed_date from s3, and compare them before upload. And since read request is cheap, this is feasible.

Currently I switched to the "aws s3 sync" provided by amazon that does the upload-only-changed-files automatically. I am not sure how they achieve that, maybe also by compare-before-upload.