与服务器同步数据时如何节约流量

来源:互联网 发布:电脑初学者软件 编辑:程序博客网 时间:2024/05/01 05:14

 

High-level steps:

  1. Create a HTTP HEAD request.
  2. Read the "Last-Modified" header and convert the string to a NSDate.
  3. Read the last modification timestamp of the local file.
  4. Compare the two timstamps.
  5. Download the file from the server if it has been updated.
  6. Save the downloaded file.
  7. Set the last modification timestamp of the file to match the "Last-Modified" header on the server 

 

原创粉丝点击