简体   繁体   中英

Sending the content of a file from the server to the browser conditionally

What is the mechanism to send the content of a file from a server to the browser only if the file is updated?

For example, I have a file abc.bin on the server which will be updated regularly. Every time the file is updated/modified, the server must send the content to the browser. What method exists to do this?

Your option is either to write a script which polls for the latest version number and compares it with the latest version number on the client side. If found it downloads the file via a hidden iframe or something like that.

Or you use some web socket based solution. Eg Pusher offers a service for something like that.

In mobile apps that design is called push notifications. -> use the terminology to find further information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM