LoggedIn Posted January 6, 2008 Share Posted January 6, 2008 Hello. I'm trying to make a script of mine cacheable because it's not going to change often and it is expected to be quite large. As well, as reduce load on my server. Since dates aren't stored in the database the script uses, I'm using an ETag for the cache header information. I have the basics set up fine. The script currently uses the $_SEVER['IF_NONE_MATCH'] global to check if a single ETag matches. The trouble is that the script doesn't obey the RFC 2616 specs very well. I wish to have it work as if the script was a static file. The problems is that the script doesn't do any checking for the headers; If-Match & If-Range which is required for conditional GETs. While I could code the If-Match without difficultly, I haven't got a clue about getting If-Range working as it should. So does anyone know a library or a code snippet for PHP that'll handle the cache headers correctly? mod_perl has an function called meets_conditions() that'll apparently handle all the cache information once it's set, which is exactly what I'm looking for. PHP doesn't offer something like this does it? Huge thanks to any replies. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.