MooTools Depender, Safari, etags and 412 Precondition Failed

/**
* This replaces the default MooTools more Depender.request function to use
* HTTP "get" rather than "post".
*
* When sending requests for files via the depender, I was finding that Safari
* wasn't getting and re-evaluating them the second time I visited the page.
* This was because an etag was sent with each script.
*
* Safari responds to etags properly and adds "If-None-Match" and
* "If-Modified-Since" headers to another request for the same file. This makes
* Apache respond with a 412 status (Precondition Failed) as it should do for
* "post" requests (according to RFC 2616).
*
* Unfortunately Safari doesn't then deal with the 412 as it does with a 304
* (Not Modified). It doesn't grab what it has in the cache and put it in the
* response, it gives you nothing.
*
* For "get" requests, Apache has to respond with a 304, or 200 or whatever, but
* not 412. So we change the request method so we don't have to deal with 412.
*/
Depender.request = function(url, callback){
    new Request.JSON({
        url: url,
        secure: false,
        onSuccess: callback,
        method:'get'
    }).send();
};

24,935 thoughts on “MooTools Depender, Safari, etags and 412 Precondition Failed

  1. A person necessarily lend a hand to make significantly posts I might
    state. This is the first time I frequented your website page and thus far?
    I amazed with the analysis you made to make this actual publish amazing.
    Excellent task!

  2. Hello there, I do believe your web site may be
    having internet browser compatibility issues. When I take a look at your website in Safari, it
    looks fine however when opening in IE, it’s got some overlapping issues.

    I simply wanted to give you a quick heads up! Besides that, excellent site!

  3. Hello to every body, it’s my first pay a quick visit of this webpage; this website includes remarkable and really good stuff in favor of readers.

  4. Hello there! This article could not be written any better!
    Looking at this post reminds me of my previous roommate!
    He continually kept preaching about this. I’ll send this post to him.
    Pretty sure he’s going to have a great read. Thanks for sharing!

    Here is my web-site Pecinta Togel

  5. I have been browsing online more than 3 hours these days, but I by no means
    discovered any fascinating article like yours. It’s lovely value enough for me.
    Personally, if all web owners and bloggers made good content material
    as you probably did, the net shall be a lot more useful than ever before.

  6. This design is wicked! You obviously know how to keep a reader
    entertained. Between your wit and your videos,
    I was almost moved to start my own blog (well, almost…HaHa!) Great job.
    I really enjoyed what you had to say, and more than that, how you presented it.

    Too cool!

  7. An intriguing discussion is definitely worth
    comment. There’s no doubt that that you ought to write more about this issue, it
    might not be a taboo matter but typically people don’t talk about these subjects.
    To the next! Many thanks!!

  8. It’s impressive that you are getting thoughts from this piece of writing as well as from our dialogue made
    at this place.

  9. Wow, marvelous blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of your site is great, let
    alone the content!

  10. This is a good tip particularly to those fresh to
    the blogosphere. Simple but very accurate information… Appreciate your sharing this one.
    A must read article!

  11. Why users still make use of to read news papers when in this technological globe everything is presented on net?

  12. Does your site have a contact page? I’m having a tough time locating it but, I’d
    like to shoot you an e-mail. I’ve got some recommendations for your blog you might be interested in hearing.

    Either way, great blog and I look forward to seeing it grow over time.

  13. I just like the helpful information you supply on your articles.
    I will bookmark your weblog and test again here frequently.
    I am moderately certain I will learn many new stuff proper right here!

    Good luck for the following!

  14. Thanks a bunch for sharing this with all people you really realize what
    you’re speaking approximately! Bookmarked. Kindly also visit my
    site =). We could have a link trade contract between us

  15. I was curious if you ever considered changing the layout of your site?
    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or
    two images. Maybe you could space it out better?

  16. Hi there! This post could not be written much better! Looking through this post reminds me of my previous roommate!

    He constantly kept preaching about this. I’ll forward this
    post to him. Pretty sure he’ll have a very good read.
    I appreciate you for sharing!

    Also visit my web blog Gacor

  17. Wow that was odd. I just wrote an very long comment but after I clicked
    submit my comment didn’t show up. Grrrr… well I’m not writing all
    that over again. Regardless, just wanted to say superb blog!

  18. Hi there just wanted to give you a brief heads up
    and let you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different internet browsers and both show the same results.