question

ddiez avatar image
ddiez asked

Query Content "LastModified" from Client

Hello!

I'm considering using Playfab's file management system to store several assets from my game, but I've checked out the documentation about GetContentDownloadUrl and it only returns the URL from the file, while I think I would need the "LastModified" property from the asset to develop some kind of local cache on the local device and only update it when the assets have been modified...

Why is it not included in the response? is there any other way to do it?

Thanks in advance!

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

The Content service is a CDN (specifically CloudFront at the moment), so the recommended best practice is to actually put a version number in the name of the content file/key. The reason for this is that when you update a file, it can take up to 24 hours for it to be fully available across all endpoints. But new files are immediately available. So, the process should be: Update with a new file (containing the version number), update a Title Data that contains a "master list" of your content, if needed, and delete the old file (once you've finished testing). Because of the 24 hour propagation time, a "LastModified" in the URL response would be inaccurate for an indeterminate number of endpoints until that time had completed.

3 comments
10 |1200

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

ddiez avatar image ddiez commented ·

Oh, I see.. That's not seems a really elegant solution, but if there's no other option I would do as you say. Do you know if there is any plan to change this in the future?

0 Likes 0 ·
brendan avatar image brendan ddiez commented ·

All Content Delivery Networks (CDNs) use caching. They have distribution nodes all over the world, to optimize data transfer, and are designed to be as cost-effective as possible, so that you can deliver content to your players with minimal cost. Because of that, there will always be a significant delay in the time it takes for all nodes worldwide to have the latest version of a file which has been updated - 24 hours being very common for CDNs. As I said, we use AWS CloudFront for our CDN, and no, we're not aware of any plan by Amazon to change the update time for cache expiration.

0 Likes 0 ·
ddiez avatar image ddiez brendan commented ·

Ok Brendan, Thank you for your answer!

0 Likes 0 ·

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.