A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearDo proxied assets get cached? - page 1
User InfoPosts
Do proxied assets get cached?#1
I have an application and in order to get the images to load into the app I had to use a proxy. So the urls for the images are not .jpg they are .php?var=value They seem to load much slower even after they have already loaded once, I don(t really know how it works, but I am thinking that the proxied images are not being cached. Am I correct?

Thanks.

posted date: 2009-04-15 09:21:00


Re: Do proxied assets get cached?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-15 09:21:01


Re: Do proxied assets get cached?#3
Your PHP-file might have declared a no-cache flag, or a low expiry time. Try opening both urls in a viewer which shows the full http headers.Every proxy has its own settings how to deal with caching and different file types. A JPG is often seen as a static file, so it(s safe to cache it. PHP files however are seen as dynamic scripts, who produce a different output every time. But this completely depends on your proxy(s configuration.

posted date: 2009-04-15 09:28:00


Re: Do proxied assets get cached?#4
Well the proxy accepts parameters for mime-type and headers, I have the mime-type set to "image/jpeg" but I don't know what to put for the headers so I didn't set them. Do you know what I should put for the headers? Thanks.

posted date: 2009-04-15 10:12:00


Re: Do proxied assets get cached?#5
Nevermind after studing the script it looks like it is just checking to see if the parameter headers == "true". So I guess I should set that?

posted date: 2009-04-15 10:21:00


Re: Do proxied assets get cached?#6
IE (and maybe other browsers) doesn(t cache URLs with any kind of ?query=string&foo=bar if there are no caching headers in the response. You have to explicitly set the Cache-Control and Expires headers for these to be cached.In PHP, the way to set headers is this:// can be cached by browser, and also by intermediate caches (i.e. by everybody)header((Cache-Control: public();// is fresh (doesn(t have to be re-checked) until that dateheader((Expires: Fri, 17 Apr 2009 23:50:00 GMT(); Caveat: you need to send headers before content, unless you use output buffering.

posted date: 2009-04-15 11:28:00


Re: Do proxied assets get cached?#7
Can you please tell me or point me to a place that explains how to set that? Thanks.

posted date: 2009-04-15 11:34:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.