0

For SEO reasons I am sending some images using PHP readfile and URL rewrite. I save images in a folder with numerical id (id.jpg) but serve the image with keywords (some-seo-word-id.jpg). While the scripts runs smoothly and show images effectively, however in pages with multiple images (5 to 6) it fails to send all images correctly.

Refreshing the pages 2 to 3 times sometimes shows all images, sometimes it does not ! Since the max image size delivered using PHP readfile is 70-140 KB each I highly doubt that memory can be an issue. My question is

  1. Is there any better approach to this only with Apache rewrite.
  2. How does Facebook deliver all images effectively with php ? There url are something like this https://www.facebook.com/photo.php?fbid=XXXXXXXXX27&set=a.4533609xxxx.xxxx099.xxxx210426&type=1&theater
  3. will server side caching in binary format help ? To me this should not affect much as readfile of an image or cached file will still read a particular file (cached file instead of image !)
jahajee.com
  • 3,683
  • 4
  • 21
  • 26
  • Why don't you save image as *some-seo-word-id.jpg* and let http caching on your http server? – venca Jun 11 '15 at 08:08
  • take a look at http://stackoverflow.com/questions/16388959/url-rewriting-with-php and in other subject Facebok displays all the images through php to ensure security checking for permissions on the image – PerroVerd Jun 11 '15 at 08:11
  • Because then I won't be able to use the same image somewhere else ! `some-seo-word.jpg` is content specific and same image can be used with different seo results . – jahajee.com Jun 11 '15 at 08:12

0 Answers0