Keil Logo

Technical Support

On-Line Manuals

RL-ARM User's Guide (MDK v4)

RL-RTX RL-FlashFS RL-TCPnet TCP Socket Opening TCP Connection TCP Active Open TCP Passive Open Sending TCP Data Example for Sending Data Multiple TCP Connections UDP Socket Opening UDP Connection Sending UDP Data When DHCP Enabled When ARP Cache Empty Example for Sending Data IP Multicasting Multiple UDP Connections Configuring RL-TCPnet Static Configuration System Definitions Ethernet Network Interface PPP Network Interface SLIP Network Interface UDP Socket TCP Socket BSD Socket HTTP Server Telnet Server TFTP Server TFTP Client FTP Server FTP Client DNS Client SMTP Client SNMP Agent SNTP Client Error Function Runtime Configuration Library Files Using RL-TCPnet Stand Alone With RTX Kernel Event Driven Operation IP Address Assignment Ethernet Interface PPP Interface SLIP Interface Localhost Applications HTTP Server Script Language CGI Functions Ajax Support Using XML XML Example How it works SOAP Support SOAP Interface Large POST Messages Web Pages Default Page Error Pages Web on SD Card Web Update File System Interface Http Caching How it works Internal Web External Web Multi-user Authentication Using RAM File System FCARM File Converter PRINT Directive NOPRINT Directive PAGEWIDTH Directive PAGELENGTH Directive ROOT Directive Telnet Server Command Line Interface Multi-user Authentication Sending Reply Message Short Reply Long Reply Continuous Screen Update TFTP Server File System Interface TFTP Client File System Interface FTP Server File System Interface Multi-user Authentication Supported Commands FTP Client File System Interface SMTP Client SNMP Agent MIB Database MIB Interface MIB Entry MIB Table DNS Resolver Starting DNS Device Drivers Ethernet Driver Interrupt Mode Modem Driver Serial Driver Using Serial Link Cable Connection Modem Connection Windows Dial-up Add Direct Serial Link New Dial-up Connection Configure PPP Dial-up Configure SLIP Dial-up Debugging Enabling Debug Debug Level Redirecting Output Function Overview BSD Routines CGI Routines Ethernet Routines FTP Routines HTTP Routines IGMP Routines Miscellaneous Routines Modem Routines PPP Routines Serial Routines SLIP Routines SMTP Routines SNMP Routines System Functions TCP Routines Telnet Routines TFTP Routines UDP Routines RL-CAN RL-USB Example Programs Library Reference Appendix

How it works

The Embedded Web server supports the HTTP local caching by the browser. For static resources, what are basically all except the scripts, the server sends the http header with the last modified date tag in the response.

Resource not cached

Here is an example, recorded from HTTP_demo. The browser opens a web page, which is not yet cached locally.

  • The browser opens a default page:
    http://mcb2300
    
  • This generates the following http request for the web server:
    GET / HTTP/1.1
    Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-
    shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint,
    application/msword, application/xaml+xml, application/vnd.ms-xpsdocument,
    application/x-ms-xbap, application/x-ms-application, */*
    Accept-Language: en-us
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
    Trident/4.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR
    3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR
    3.5.30729)
    Accept-Encoding: gzip, deflate
    Host: mcb2300
    Connection: Keep-Alive
    
  • The web server opens a default page index.htm and sends it to the browser with the following http header:
    HTTP/1.1 200 OK
    Server: Keil-EWEB/2.1
    Content-Type: text/html
    Last-Modified: Thu, 19 Nov 2009 07:46:25 GMT
    Connection: close
    // and the content of 'index.htm'
    
  • The browser, when receiving the Last-Modifed http header, stores this file to local cache together with the url and date tag.

Resource cached

When the browser tries to open the same page again, it first checks the local cache. The file index.htm is already there, so it sends a different request to the Web server.

  • The browser sends a different http header in the request:
    GET / HTTP/1.1
    Accept: */*
    Accept-Language: en-us
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
    Trident/4.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR
    3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR
    3.5.30729)
    Accept-Encoding: gzip, deflate
    If-Modified-Since: Thu, 19 Nov 2009 07:46:25 GMT
    Host: mcb2300
    Connection: Keep-Alive
    
  • Now, the Web server is also informed that the requested file is cached. The Web server checks the date, if the browser caches the same file version. If the date tags are equal, the Web server sends only a short response:
    HTTP/1.1 304 Not Modified
    Server: Keil-EWEB/2.1
    Connection: close
    
  • The browser now uses the locally cached index.htm

Outdated resource cached

If the date tags are not equal, the file cached by browser is outdated. The Web server sends the updated index.htm. The browser updates the local cache and uses an updated file.

  • HTTP/1.1 200 OK
    Server: Keil-EWEB/2.1
    Content-Type: text/html
    Last-Modified: Thu, 19 Nov 2009 09:38:54 GMT
    Connection: close
    // and the new content of 'index.htm'
    
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.