What happens if original file is updated when using Cloudfront?

Let’s say we are using Cloudfront with our blog in origin pull and if we update a plugin or wordpress itself, does Cloudfront automatically starts serving the updated files or does its cache needs to be purged, before it will server updated files?

It depends on your caching headers. Cloudfront will honor your expires and cache-control headers and it’s really only effective if the content is cacheable so you will probably need to purge the cache. That said, if you are updating files that require a cache purge then you may not be doing it right because your end user’s browsers will also be caching the content and you have no way to force a purge there. Usually you want to be in a position where you are changing the file URL every time the file is changed so it will look like a new file to all of the caches but it can still be cached for a long time.

I do it on WebPagetest by adding a ?v=1234 (some incrementing number for the version) to the end of my files when I change them but you need to modify the HTML or css that references them (and a query string isn’t the best way to do it but it’s generally easy and transparent).