Jump to content

afshin.m

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

afshin.m's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, i want to set a custom (and empty) 404 error for my static contents like CSS, Gif, Jpeg etc. i found this code : <FilesMatch "\.(css|png|jpg|jpeg|gif|bmp|swf|flv)$"> ErrorDocument 404 error-404.txt </FilesMatch> But it not worked for images that located in sub folders, it works for images that located in the root folder and where my .htaccess file located. Please help, thanks
  2. Hi, Thanks ignace but when i use this header, content not loaded and returns 0 bytes of data. (For example CSS not loaded and i my website without CSS style)
  3. Hi, I use this headers for my PHP file: header("Last-Modified: " . gmdate("D, d M Y H:i:s",filemtime("../cache/css/".$md5file.".css")) . " GMT"); header("Expires: " . gmdate("D, d M Y H:i:s", time()+(2592000)) . " GMT"); header('Cache-Control: public, max-age=2592000'); But when i check my website in FireBug, i get 200 OK response but i think this is should response 304 Not modified ...? See this details : [b]Response Header[/b] Date Sat, 05 Jun 2010 07:04:53 GMT Server Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 X-Powered-By PHP/5.3.1 Last-Modified Wed, 28 May 2008 21:02:26 GMT Expires Mon, 05 Jul 2010 07:04:53 GMT Cache-Control public, max-age=2592000 Content-Encoding gzip Vary Accept-Encoding Content-Length 408 Keep-Alive timeout=5, max=99 Connection Keep-Alive Content-Type text/css [b]Request Headers[/b] Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Accept text/css,*/*;q=0.1 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Referer http://localhost/cache/test.php Cookie PHPSESSID=fnrlds14pqedj0s96mvasfqvo5 If-Modified-Since Wed, 28 May 2008 21:02:26 GMT Cache-Control max-age=0 And more about cache: Last Modified Sat Jun 05 2010 10:34:53 GMT+0330 (Iran Standard Time) Last Fetched Sat Jun 05 2010 10:34:53 GMT+0330 (Iran Standard Time) Expires Mon Jul 05 2010 10:34:53 GMT+0330 (Iran Standard Time) Data Size 408 Fetch Count 23 Device disk Is there any solution? Thanks.
  4. Hello all. I'm looking for a PHP image compression class... Please see : http://tools.dynamicdrive.com/imageoptimizer/ Or http://www.sitereportcard.com/imagereducer.php Or http://developer.yahoo.com/yslow/smushit/ Thanks.
  5. Thanks, good Now i check a website with my caching system and also enable YSlow... I get this errors: Grade F on Add Expires headers There are 93 static components without a far-future expiration date. * (no expires) http://localhost/cache/test_files/mod_thumbsup.css ... I think this is because i redirect all images/js/css with .htaccess to another address like this : css_minify.php?css=[cssaddress] image_compress.php?image=[imageaddress] js_packer.php?js=[jsaddress] And also i don't set any expires header in my PHP files (in js_packer.php for example) How can i set any expires header in my PHP files? Thank you
  6. so useful...i don't use this parameter in my caching system so when i refresh the page, nothing loaded from cache And just another question, is there any limitation for browser caching? Thank you!
  7. Thanks for your useful response but i can you please explain HTTP_ETag and give some examples? And about (304 = not changed), this is only relevant to client and browser cache as far as i know, right? Thank you
  8. Hello all friends, i use : php_value auto_append_file "afshin.php" in my .htaccess file but i want to exclude afshin.php from some files .... for example from john.php How can i do it?
  9. All friends, thanks for your responds. Based on my research about caching systems, it's not possible to re-generate cache file only when the file changed, you should use a period (for example 5min) to re-generate cache file or remove all caches and make a new cache file. This is true?
  10. Thank you dear Zyx, Many caching systems work with time, it means renew the cache file every 5min etc. But i don't want to do that, i want to renew the cache file only WHEN the page content changed... Thank you again
  11. Hello, I'm programming an advanced caching system that work with PHP but i have an small problem. I want to know when the pages content changed to remove the page cache from cache folder and make a new cache file with new content. i don't want to work with cache time... Please help me, thanks a lot.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.