transitioned eyre to use weak etags

This commit is contained in:
Anton Dyudin 2015-09-23 13:50:31 -07:00
parent efeeef77f1
commit c76ee92346

View File

@ -431,13 +431,14 @@
urb.waspFrom = function(sel,attr){ urb.waspFrom = function(sel,attr){
Array.prototype.map.call(document.querySelectorAll(sel), Array.prototype.map.call(document.querySelectorAll(sel),
function(ele){ function(ele){
if(!ele[attr] || (new URL(ele[attr])).host != document.location.host) return; if(!ele[attr] || (new URL(ele[attr])).host != document.location.host)
return;
var xhr = new XMLHttpRequest() var xhr = new XMLHttpRequest()
xhr.open("HEAD", ele[attr]) xhr.open("HEAD", ele[attr])
xhr.send() xhr.send()
xhr.onload = function(){ xhr.onload = function(){
var tag = JSON.parse(this.getResponseHeader("etag")) var dep = this.getResponseHeader("etag")
if(tag) urb.wasp(tag) if(dep) urb.wasp(JSON.parse(dep.substr(2)))
}})} }})}
if(urb.wasp){urb.waspFrom('script','src'); urb.waspFrom('link','href')} if(urb.wasp){urb.waspFrom('script','src'); urb.waspFrom('link','href')}
''' '''
@ -771,7 +772,7 @@
== ==
~| q.q.cay ~| q.q.cay
=+ ((hard ,[mit=mite rez=octs]) q.q.cay) =+ ((hard ,[mit=mite rez=octs]) q.q.cay)
=+ dep=(crip (pojo %s (scot %uv p.sih))) =+ dep=(crip "W/{(pojo %s (scot %uv p.sih))}")
(give-thou 200 ~[etag/dep content-type/(moon mit)] ~ rez) (give-thou 200 ~[etag/dep content-type/(moon mit)] ~ rez)
== ==
== ==