Commit graph

28 commits

Author SHA1 Message Date
Jo-Philipp Wich
001e15a0db [PATCH] Explicit Cache-Control for lucid.http static content
The Chrome web browser revalidates every resource if no explicit Cache-Control or Expires HTTP/1.1 header is sent. This makes the page loads appear to take a long time on pages with a few external resources, adding 300-500ms 
per item. This includes the XHR json responses that set page images, like wireless signal indicators and the like-- the images are revalidated on every XHR response. As an example, the Network -> Interfaces page generates 16 
requests to the lucid http server:

    Main HTML
    cascade.css
    xhr.js
    tabbg.png
    cbi.js
    loading.gif
    ethernet_disabled.png
    reload.png
    reset.gif
    edit.gif
    remove.gif
    add.gif
    bridge.png
    vlan.png
    wifi.png
    iface_status 

Of those, 14 should be pulled from cache but they are all valdiated. The lucid server returns the correct 304 (Not Modified) responses but it delays the apparent page load time because of the backlog it creates at the http 
server.

I would suggest setting explicit cache control on all files returned by the lucid http directory dispatcher. The "Expires" header is reportedly more widely supported, however this relies on the clock on the OpenWrt? system 
being accurate, which may not be the case. The "Cache-Control: max-age=" allows the server to set a timeout in seconds. I've included a patch that sets revalidate interval to 1 year, which is the value recommended by google.
Reference:  http://code.google.com/speed/page-speed/docs/caching.html

Note this could create an issue if there are luci application which are generating files which change that are being served by the lucid http DirectoryPublisher?. I'm not sure if there is anyone doing that. If needed, this can 
probably be created as an option to the DirectoryPublisher? config stanza for each vhost.

Finally, this only affects the Google Chrome browser, as both IE9 and Firefox seem to have their own revalidation interval in the absence of explicit cache control which may be based on the last modified time of the resource. 
Even in Chrome, this change doesn't take effect until the item is re-served with a 200 HTTP response so Chrome's cache should be cleared after this patch is applied. The patch can be extended to include cache control on 304 
responses, but I'd not worry about cluttering the code with it because the problem will solve itself once chrome redownloads the resource.
2012-01-09 00:04:54 +00:00
Jo-Philipp Wich
74630d6814 libs/lucid-http: fix regressions with recent git uci 2009-12-29 17:50:35 +00:00
Steven Barth
ffae6adf66 Avoid lacking fds 2009-11-02 15:40:53 +00:00
Steven Barth
92bbfc8ca8 Be a bit more non-standard 2009-10-26 17:55:08 +00:00
Steven Barth
36e18e87ef CBI: Cancelaction and event callbacks for Delegators
LuCId: Send Keep-Alive headers to avoid browser quirks
2009-10-26 17:40:44 +00:00
Steven Barth
9827e91105 Performance improvements, where did that get lost? 2009-07-31 19:57:07 +00:00
Steven Barth
9016ae7ad9 Increase timeout for HTTP, fixing some browser problems 2009-07-28 11:59:13 +00:00
Steven Barth
17e7f67a7c Add native support for homepages 2009-07-27 12:09:46 +00:00
Steven Barth
a77f1b91ae Allow Basic-Auth pass-through 2009-07-25 10:47:26 +00:00
Steven Barth
b8ab3b9dac Add: luci.http.splice to allow direct copying of data from a file
descriptor
2009-07-25 07:27:05 +00:00
Jo-Philipp Wich
ed4b7a5fbb libs/lucid-http: make chunksinks cope with string-like udata 2009-07-25 00:55:24 +00:00
Steven Barth
f1e1f7a451 Revert "libs/lucid-http: prepare external indexing and tree building in luci handler"
This reverts commit e70104be85933a0d6cef5b8639f3a042e6d76896.
2009-07-24 15:33:06 +00:00
Jo-Philipp Wich
60aaab2ede libs/lucid-http: prepare external indexing and tree building in luci handler 2009-07-23 03:22:45 +00:00
Steven Barth
7ba12e9c5e Move memory limit to lucid, reincrease thread limit 2009-07-10 16:39:30 +00:00
Jo-Philipp Wich
8c359115f9 libs/lucid-http: use SERVER_ADDR as fallback 2009-06-16 14:41:43 +00:00
Steven Barth
b3a7ff9f8f Catchall workaround for strange sockaddresses by Jow 2009-06-16 14:27:43 +00:00
Steven Barth
c47be2e727 GSoC: Documentation #2 2009-06-14 08:51:43 +00:00
Steven Barth
f9263e00c1 GSoC: Documentation #1 2009-06-13 18:16:34 +00:00
Steven Barth
a75d304028 Revert "libs/lucid-http: copyz() causes a Kernel oops on brcm-2.4, revert to copy() for now (#70)"
Fixed in nixio
2009-06-10 23:29:10 +00:00
Jo-Philipp Wich
0649e94571 libs/lucid-http: copyz() causes a Kernel oops on brcm-2.4, revert to copy() for now (#70) 2009-06-10 22:43:11 +00:00
Steven Barth
f242ed5aba HTTPd: No keep-alive after POST request, because we do not check state
of incoming data
2009-06-07 13:51:18 +00:00
Steven Barth
8a3f3e860a Fix query string detection 2009-06-01 18:30:41 +00:00
Jo-Philipp Wich
217af86e35 lucid: fix separation of query string and url in server handler 2009-06-01 18:10:37 +00:00
Steven Barth
693366bdd8 http/1.1 detection 2009-05-27 19:12:58 +00:00
Steven Barth
fa25902656 HTTP-Timeout to 5 seconds 2009-05-27 18:26:07 +00:00
Steven Barth
73eae62580 Fix redirector 2009-05-26 17:44:27 +00:00
Steven Barth
d2ce28a71e Fix non-HEAD HTTP-Responses 2009-05-25 10:31:16 +00:00
Steven Barth
8c4f847ea5 GSoC Commit #1: LuCId + HTTP-Server 2009-05-23 17:21:36 +00:00