question

forplayers.co avatar image
forplayers.co asked

CDN Confusion concerning uploading time (file availability)

Hello,

There is something a bit confusing concerning the CDN feature. It is said:

File uploading
Your file will be available immediately
File overwriting
The old file will appear to users for up to 24 hours until it's overwritten with the new file
File deletion
The file will continue to exist for up to 24 hours while the delete command removes it from all edge locations

If I upload succesively a file e.g. an unity asset bundle, will it be available immediately to all of the users or is there a gap time of 24 hours?

Regards,

Alexandre

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Correct - if you re-upload a new file to the same filename ("Key") in a CDN, when that updated content will be available to players will depend upon the TTL (Time to Live) of the cache. In CDNs, the content is cached at each node. In our case, the TTL is 24 hours. So, if CDN node A just got the file from central storage, it'll be 24 hours before it checks for an updated version when that content is requested from it. Another node might not have the content cached at all, and so would start serving it immediately.

The simplest way to work around this is by using a different Key for the file each time - one technique is to make the version number part of the name of the file. Then, you simply update a "master index" of your content, which you store in Title Data.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

forplayers.co avatar image forplayers.co commented ·

Thank you very much for the reply. Luckily, I used a similar technique in the meantime. This technique is even better than using overwritten files because we can have different files for different app versions, which avoids compatibility problems. It's also much more manageable.

0 Likes 0 ·
davidjohn2121 avatar image
davidjohn2121 answered

CDNs are an important part of Internet infrastructure that are frequently used without a full understanding of what’s happening behind the scenes. You’ll hear people saying, “oh, we put that on the CDN” or “make sure static assets go on the CDN,” when they have only a rudimentary idea of what CDNs are and how they work. As with most pieces of technology, CDNs are not magic and actually work in a pretty simple and straightforward manner.
Physics determines how fast one computer can contact another over physical connections, and so attempting to access a server in China from a computer in the United States will take longer than trying to access a U.S. server from within the U.S. To improve user experience and lower transmission costs, large companies set up servers with copies of data in strategic geographic locations around the world. This is called a CDN, and these servers are called edge servers, as they are closest on the company’s network to the end-user.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

forplayers.co avatar image
forplayers.co answered

Hello @davidjohn2121

When I first clicked on File Management, I had one goal: making my file available to download. As you saw, I didn't print the wikipedia page concerning CDN and even if I had wanted I woudn't have done so because I'll reveal you something - you would better close your eyes - I didn't know what CDN meant. I thought it was a custom name chosen by the Playfab team.

The thing which confused my brain was that an uploaded file was available immediately and that an overwritten file wasn't appearing to users for up to 24 hours, whereas an overwritten file is "just" an uploaded file with the same name than the previous one.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.