top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Web:How to enable the image caching when images are coming from thirdparty?

+2 votes

Now its a real problem which we are facing at QueryHome, we have images which were present on our server and caching was working now we have moved these images to the CDN and caching is not working.

We have following .htaccess for enabling the caching -

<IfModule mod_expires.c>
ExpiresActive On
<FilesMatch "\.(ico|jpg|jpeg|png|gif)$">
ExpiresDefault "access plus 2 weeks"
<FilesMatch "\.(js|css|swf)$">
ExpiresDefault "access plus 2 weeks"
posted Apr 24, 2014 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

I found the solution and thought to share so that it can be beneficial for all -
I was assuming that setting up the correct .htaccess in my website would do the trick but I was wrong as these are coming from third part so caching enabling has to be done at those not on my site.

Since I was using Google app engine and the trick is just open the app.yaml file for your application and add the following line (default_expiration: "4d 5h") something like

application: myapp
version: 1
runtime: python27
api_version: 1
threadsafe: true

default_expiration: "4d 5h"


answer Apr 25, 2014 by Salil Agrawal
Similar Questions
+3 votes

I went through this Discussion:

I have a web server There is a JSON-Server running on another server What I have to achieve is to fetch a list of URLs (in form of JSON response) from server-2 and loop through the urls and fetch them from the server-1. In the meantime i have to animate these images on the browser by Fading the images one after the another.

The algorithm is something like this:-

   FETCH the URLs from server-1 and store them in a cache C
   Loop until C.length
      Fetch first K images by forking a thread.
      animate k images

How can I optimize K? Is my approach right?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.