Go Back   CodingForums.com > Web Projects and Services Marketplace > Web Projects > Small projects (quick fixes and changes)

Notices

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-18-2009, 09:29 PM   PM User | #1
autotech
New Coder

 
Join Date: Apr 2009
Posts: 63
Thanks: 2
Thanked 0 Times in 0 Posts
autotech is an unknown quantity at this point
conditional Get implementation

1) Project Details: (be as specific as possible): I have deflate compression set up through my Apache server, but I'm unfamiliar with setting up the "conditional GET". Need someone to do the task or walk me through it.

2) Payment Amount: Not sure. Seems to be a small job. $50?

3) Payment method/ details (Paypal, check? Timeline?): Paypal

4) Additional Info (about project or potential bidders): Would like someone very familair with the task.
autotech is offline   Reply With Quote
Old 07-20-2009, 07:46 AM   PM User | #2
it career
Banned

 
Join Date: Jun 2007
Location: Web Designer
Posts: 321
Thanks: 0
Thanked 6 Times in 6 Posts
it career can only hope to improve
Quote:
Originally Posted by autotech View Post
1) Project Details: (be as specific as possible): I have deflate compression set up through my Apache server, but I'm unfamiliar with setting up the "conditional GET". Need someone to do the task or walk me through it.

2) Payment Amount: Not sure. Seems to be a small job. $50?

3) Payment method/ details (Paypal, check? Timeline?): Paypal

4) Additional Info (about project or potential bidders): Would like someone very familair with the task.
Here is the code for conditionalGet.
Code:
function doConditionalGet($timestamp) {
    // A PHP implementation of conditional get, see 
    //   http://fishbowl.pastiche.org/archives/001132.html
    $last_modified = substr(date('r', $timestamp), 0, -5).'GMT';
    $etag = '"'.md5($last_modified).'"';
    // Send the headers
    header("Last-Modified: $last_modified");
    header("ETag: $etag");
    // See if the client has provided the required headers
    $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ?
        stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) :
        false;
    $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ?
        stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : 
        false;
    if (!$if_modified_since && !$if_none_match) {
        return;
    }
    // At least one of the headers is there - check them
    if ($if_none_match && $if_none_match != $etag) {
        return; // etag is there but doesn't match
    }
    if ($if_modified_since && $if_modified_since != $last_modified) {
        return; // if-modified-since is there but doesn't match
    }
    // Nothing has changed since their last request - serve a 304 and exit
    header('HTTP/1.0 304 Not Modified');
    exit;
}
it career is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:14 AM.


Advertisement
Log in to turn off these ads.