Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $cachetime = 3600;
- if (isset($headers['If-Modified-Since']) && (strtotime($headers['If-Modified-Since']) > (time()-3600)))
- {
- // Client's cache IS current, so we just respond '304 Not Modified'.
- header('Last-Modified: '.gmdate('D, d M Y H:i:s', (strtotime($headers['If-Modified-Since']))).' GMT', true, 304);
- exit();
- }
- header('Last-Modified: '.gmdate('D, d M Y H:i:s', (time()-$cachetime)).' GMT', true, 200);
- ob_start();
- ?>
- [/pre]
- Place this at the end.
- [pre]
- <?php
- SendLength();
- function SendLength()
- {
- if(ob_get_length())
- {
- header("Content-Length: ".ob_get_length());
- ob_end_flush();
- die;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement