Cloudflare Pages - simple explanation of "already uploaded" when deploying?

I am successfully building a Hugo website in Cloudflare Pages, however, I’m trying to understand what Cloudflare is doing when it uploads the built assets to the “public” folder, i.e. this part of the build log:

07:53:12.882	                   | EN   
07:53:12.882	-------------------+------
07:53:12.882	  Pages            | 283  
07:53:12.882	  Paginator pages  |   0  
07:53:12.882	  Non-page files   |  43  
07:53:12.883	  Static files     |  41  
07:53:12.883	  Processed images |   2  
07:53:12.883	  Aliases          |   0  
07:53:12.883	  Sitemaps         |   1  
07:53:12.883	  Cleaned          |   0  
07:53:12.883	
07:53:12.883	Total in 27452 ms
07:53:12.902	Finished
07:53:12.903	Note: No functions dir at /functions found. Skipping.
07:53:12.903	Validating asset output directory
07:53:20.692	Deploying your site to Cloudflare's global network...
07:53:21.430	Parsed 5 valid redirect rules.
07:53:23.600	Uploading... (90/373)
07:53:26.365	Uploading... (185/373)
07:53:26.422	Uploading... (279/373)
07:53:26.581	Uploading... (373/373)
07:53:26.581	✨ Success! Uploaded 283 files (90 already uploaded) (3.66 sec)
07:53:26.581	
07:53:27.194	✨ Upload complete!

I’m specifically looking for an explanation of the “90 already uploaded” message. How does Cloudflare know what has changed and what hasn’t? In my example 90 already uploaded pretty much equates to all files that are not “Pages” (they add up to 87)… but in this build I did not change 283 Hugo pages, unless Cloudflare considers Hugo built pages as “always different”…?

From the content and type hash. Essentially we take the content and add the file extension, hash that and get a unique key. If the content doesn’t change, the hash doesn’t change and we’ll know it hasn’t changed.

So something changed in these pages, may be some CSS hash or something like that. Couldn’t say exactly without inspecting but yeah the content changed in some way. This is fully controlled by Hugo though, CF just generates a hash and compares, nothing more.

2 Likes

Thanks for your reply @WalshyMVP, very helpful to know how Cloudflare treats changes.

I suppose that the hash for pages themselves will always be different as they are rebuilt each time Hugo runs: even if I make no changes in the underlying Git repo and just do “retry deployment” on the most recent deployment Cloudflare will still upload all the pages. Images that haven’t changed are not reuploaded (thankfully).

I guess I was just trying to see how I could improve the perf of the upload part.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.