|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello all!
I wrote a script to add or update photos no more than 50 KB size. After adding photo I have possibility to update it (I mean change the photo into the other one, so not adding another photo). After updating I see still old photo, but this old photo is enlarged, I mean that this old photo has sizes (widht & height) of a new photo (just updated) but I still see this old photo, and not a new photo just updated. This problem occurs in IE 7.0.. When I update photos in Firefox, everything works fine. I can add, update photos and always I see proper photos, that is I see new photos after updating them. I have such code: <? function setExpires($expires) { header( 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); } setExpires(1); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', FALSE); header('Pragma: no-cache'); include ("configuration.php"); //setting session_start() and other things include ("gallery.php"); //script to add and update photos ?> and after above code I have such code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Tytul</TITLE> I have tried to change header() but it didn`t solve the problem. Please me. Any apprieciated Thank you in advance Marcin. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
MZ wrote:
> Hello all! > > I wrote a script to add or update photos no more than 50 KB size. After > adding photo I have possibility to update it (I mean change the photo > into the other one, so not adding another photo). After updating I see > still old photo, but this old photo is enlarged, I mean that this old > photo has sizes (widht & height) of a new photo (just updated) but I > still see this old photo, and not a new photo just updated. > > This problem occurs in IE 7.0.. When I update photos in Firefox, > everything works fine. I can add, update photos and always I see proper > photos, that is I see new photos after updating them. > > I have such code: > > <? > function setExpires($expires) { > header( > 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); > } > > setExpires(1); > header('Cache-Control: no-store, no-cache, must-revalidate'); > header('Cache-Control: post-check=0, pre-check=0', FALSE); > header('Pragma: no-cache'); > > include ("configuration.php"); //setting session_start() and other things > > include ("gallery.php"); //script to add and update photos > > ?> > > and after above code I have such code: > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > <HTML> > <HEAD> > <TITLE>Tytul</TITLE> > > > I have tried to change header() but it didn`t solve the problem. > > Please me. > Any apprieciated > > Thank you in advance > Marcin. > > Clear your browser cache. This isn't a PHP problem. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
U¿ytkownik "Jerry Stuckle" <jstucklex@attglobal.net> napisa³ w wiadomo¶ci news:S7-dnS-A-K21awnanZ2dnUVZ_uHinZ2d@comcast.com... > MZ wrote: >> Hello all! >> >> I wrote a script to add or update photos no more than 50 KB size. After >> adding photo I have possibility to update it (I mean change the photo into >> the other one, so not adding another photo). After updating I see still old >> photo, but this old photo is enlarged, I mean that this old photo has sizes >> (widht & height) of a new photo (just updated) but I still see this old >> photo, and not a new photo just updated. >> >> This problem occurs in IE 7.0.. When I update photos in Firefox, everything >> works fine. I can add, update photos and always I see proper photos, that is >> I see new photos after updating them. >> >> I have such code: >> >> <? >> function setExpires($expires) { >> header( >> 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); >> } >> >> setExpires(1); >> header('Cache-Control: no-store, no-cache, must-revalidate'); >> header('Cache-Control: post-check=0, pre-check=0', FALSE); >> header('Pragma: no-cache'); >> >> include ("configuration.php"); //setting session_start() and other things >> >> include ("gallery.php"); //script to add and update photos >> >> ?> >> >> and after above code I have such code: >> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> >> <HTML> >> <HEAD> >> <TITLE>Tytul</TITLE> >> >> >> I have tried to change header() but it didn`t solve the problem. >> >> Please me. >> Any apprieciated >> >> Thank you in advance >> Marcin. >> >> > > Clear your browser cache. This isn't a PHP problem. > > -- OK. But I cannot force every user and every visitor of my page to clear cache everytime they update photo. Is it possible to do it using some code? Maybe is it possible to implement this in JavaScript? M. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
MZ wrote:
> > U¿ytkownik "Jerry Stuckle" <jstucklex@attglobal.net> napisa³ w > wiadomo¶ci news:S7-dnS-A-K21awnanZ2dnUVZ_uHinZ2d@comcast.com... >> MZ wrote: >>> Hello all! >>> >>> I wrote a script to add or update photos no more than 50 KB size. >>> After adding photo I have possibility to update it (I mean change the >>> photo into the other one, so not adding another photo). After >>> updating I see still old photo, but this old photo is enlarged, I >>> mean that this old photo has sizes (widht & height) of a new photo >>> (just updated) but I still see this old photo, and not a new photo >>> just updated. >>> >>> This problem occurs in IE 7.0.. When I update photos in Firefox, >>> everything works fine. I can add, update photos and always I see >>> proper photos, that is I see new photos after updating them. >>> >>> I have such code: >>> >>> <? >>> function setExpires($expires) { >>> header( >>> 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); >>> } >>> >>> setExpires(1); >>> header('Cache-Control: no-store, no-cache, must-revalidate'); >>> header('Cache-Control: post-check=0, pre-check=0', FALSE); >>> header('Pragma: no-cache'); >>> >>> include ("configuration.php"); //setting session_start() and other >>> things >>> >>> include ("gallery.php"); //script to add and update photos >>> >>> ?> >>> >>> and after above code I have such code: >>> >>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> >>> <HTML> >>> <HEAD> >>> <TITLE>Tytul</TITLE> >>> >>> >>> I have tried to change header() but it didn`t solve the problem. >>> >>> Please me. >>> Any apprieciated >>> >>> Thank you in advance >>> Marcin. >>> >>> >> >> Clear your browser cache. This isn't a PHP problem. >> >> -- > > > OK. But I cannot force every user and every visitor of my page to clear > cache > everytime they update photo. Is it possible to do it using some code? > Maybe is it possible to implement this in JavaScript? > > M. > > > So, just tell them to clear their cache after uploading. That's what I do. But I guess you could display the image via a PHP script, and in your image tag add a dummy query parameter, i.e. <img src="/images/showpicture.php?pix=filename.jpg&id=12345"> where the id is a unique (or random) number. I doubt it is possible with javascript, but you can try comp.lang.javascript. I'd be very upset if some web page cleared my cache, however, and wouldn't be back. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
U¿ytkownik "MZ" <marcinzmyslowski@poczta.onet.pl> napisa³ w wiadomo¶ci news:fn2t7i$u6l$1@news.onet.pl... > > U¿ytkownik "Jerry Stuckle" <jstucklex@attglobal.net> napisa³ w wiadomo¶ci > news:S7-dnS-A-K21awnanZ2dnUVZ_uHinZ2d@comcast.com... >> MZ wrote: >>> Hello all! >>> >>> I wrote a script to add or update photos no more than 50 KB size. After >>> adding photo I have possibility to update it (I mean change the photo into >>> the other one, so not adding another photo). After updating I see still old >>> photo, but this old photo is enlarged, I mean that this old photo has sizes >>> (widht & height) of a new photo (just updated) but I still see this old >>> photo, and not a new photo just updated. >>> >>> This problem occurs in IE 7.0.. When I update photos in Firefox, everything >>> works fine. I can add, update photos and always I see proper photos, that is >>> I see new photos after updating them. >>> >>> I have such code: >>> >>> <? >>> function setExpires($expires) { >>> header( >>> 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); >>> } >>> >>> setExpires(1); >>> header('Cache-Control: no-store, no-cache, must-revalidate'); >>> header('Cache-Control: post-check=0, pre-check=0', FALSE); >>> header('Pragma: no-cache'); >>> >>> include ("configuration.php"); //setting session_start() and other things >>> >>> include ("gallery.php"); //script to add and update photos >>> >>> ?> >>> >>> and after above code I have such code: >>> >>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> >>> <HTML> >>> <HEAD> >>> <TITLE>Tytul</TITLE> >>> >>> >>> I have tried to change header() but it didn`t solve the problem. >>> >>> Please me. >>> Any apprieciated >>> >>> Thank you in advance >>> Marcin. >>> >>> >> >> Clear your browser cache. This isn't a PHP problem. >> >> -- > > > OK. But I cannot force every user and every visitor of my page to clear cache > everytime they update photo. Is it possible to do it using some code? > Maybe is it possible to implement this in JavaScript? > > M. > > I`ve done this but in the other way: <img src="images/galeria/zdjecie.jpg?<?=time(); ?> It works Thank you in advance Marcin |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Jerry Stuckle wrote:
> MZ wrote: >> Hello all! >> >> I wrote a script to add or update photos no more than 50 KB size. >> After adding photo I have possibility to update it (I mean change the >> photo into the other one, so not adding another photo). After updating >> I see still old photo, but this old photo is enlarged, I mean that >> this old photo has sizes (widht & height) of a new photo (just >> updated) but I still see this old photo, and not a new photo just >> updated. >> >> This problem occurs in IE 7.0.. When I update photos in Firefox, >> everything works fine. I can add, update photos and always I see >> proper photos, that is I see new photos after updating them. >> >> I have such code: >> >> <? >> function setExpires($expires) { >> header( >> 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); >> } >> >> setExpires(1); >> header('Cache-Control: no-store, no-cache, must-revalidate'); >> header('Cache-Control: post-check=0, pre-check=0', FALSE); >> header('Pragma: no-cache'); >> >> include ("configuration.php"); //setting session_start() and other things >> >> include ("gallery.php"); //script to add and update photos >> >> ?> >> >> and after above code I have such code: >> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> >> <HTML> >> <HEAD> >> <TITLE>Tytul</TITLE> >> >> >> I have tried to change header() but it didn`t solve the problem. >> >> Please me. >> Any apprieciated >> >> Thank you in advance >> Marcin. >> >> > > Clear your browser cache. This isn't a PHP problem. > Yes. Is there a way to tell the browser to 'refresh this file everytime' in the download? |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
MZ wrote:
> > U�ytkownik "MZ" <marcinzmyslowski@poczta.onet.pl> napisa� w wiadomo�ci > news:fn2t7i$u6l$1@news.onet.pl... >> >> U�ytkownik "Jerry Stuckle" <jstucklex@attglobal.net> napisa� w >> wiadomo�ci news:S7-dnS-A-K21awnanZ2dnUVZ_uHinZ2d@comcast.com... >>> MZ wrote: >>>> Hello all! >>>> >>>> I wrote a script to add or update photos no more than 50 KB size. >>>> After adding photo I have possibility to update it (I mean change >>>> the photo into the other one, so not adding another photo). After >>>> updating I see still old photo, but this old photo is enlarged, I >>>> mean that this old photo has sizes (widht & height) of a new photo >>>> (just updated) but I still see this old photo, and not a new photo >>>> just updated. >>>> >>>> This problem occurs in IE 7.0.. When I update photos in Firefox, >>>> everything works fine. I can add, update photos and always I see >>>> proper photos, that is I see new photos after updating them. >>>> >>>> I have such code: >>>> >>>> <? >>>> function setExpires($expires) { >>>> header( >>>> 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); >>>> } >>>> >>>> setExpires(1); >>>> header('Cache-Control: no-store, no-cache, must-revalidate'); >>>> header('Cache-Control: post-check=0, pre-check=0', FALSE); >>>> header('Pragma: no-cache'); >>>> >>>> include ("configuration.php"); //setting session_start() and other >>>> things >>>> >>>> include ("gallery.php"); //script to add and update photos >>>> >>>> ?> >>>> >>>> and after above code I have such code: >>>> >>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> >>>> <HTML> >>>> <HEAD> >>>> <TITLE>Tytul</TITLE> >>>> >>>> >>>> I have tried to change header() but it didn`t solve the problem. >>>> >>>> Please me. >>>> Any apprieciated >>>> >>>> Thank you in advance >>>> Marcin. >>>> >>>> >>> >>> Clear your browser cache. This isn't a PHP problem. >>> >>> -- >> >> >> OK. But I cannot force every user and every visitor of my page to >> clear cache >> everytime they update photo. Is it possible to do it using some code? >> Maybe is it possible to implement this in JavaScript? >> >> M. >> >> > > > I`ve done this but in the other way: > > <img src="images/galeria/zdjecie.jpg?<?=time(); ?> > > It works > > Thank you in advance > Marcin Neat trick Marcin. Another one to remember. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
MZ wrote:
> > U¿ytkownik "MZ" <marcinzmyslowski@poczta.onet.pl> napisa³ w wiadomo¶ci > news:fn2t7i$u6l$1@news.onet.pl... >> >> U¿ytkownik "Jerry Stuckle" <jstucklex@attglobal.net> napisa³ w >> wiadomo¶ci news:S7-dnS-A-K21awnanZ2dnUVZ_uHinZ2d@comcast.com... >>> MZ wrote: >>>> Hello all! >>>> >>>> I wrote a script to add or update photos no more than 50 KB size. >>>> After adding photo I have possibility to update it (I mean change >>>> the photo into the other one, so not adding another photo). After >>>> updating I see still old photo, but this old photo is enlarged, I >>>> mean that this old photo has sizes (widht & height) of a new photo >>>> (just updated) but I still see this old photo, and not a new photo >>>> just updated. >>>> >>>> This problem occurs in IE 7.0.. When I update photos in Firefox, >>>> everything works fine. I can add, update photos and always I see >>>> proper photos, that is I see new photos after updating them. >>>> >>>> I have such code: >>>> >>>> <? >>>> function setExpires($expires) { >>>> header( >>>> 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); >>>> } >>>> >>>> setExpires(1); >>>> header('Cache-Control: no-store, no-cache, must-revalidate'); >>>> header('Cache-Control: post-check=0, pre-check=0', FALSE); >>>> header('Pragma: no-cache'); >>>> >>>> include ("configuration.php"); //setting session_start() and other >>>> things >>>> >>>> include ("gallery.php"); //script to add and update photos >>>> >>>> ?> >>>> >>>> and after above code I have such code: >>>> >>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> >>>> <HTML> >>>> <HEAD> >>>> <TITLE>Tytul</TITLE> >>>> >>>> >>>> I have tried to change header() but it didn`t solve the problem. >>>> >>>> Please me. >>>> Any apprieciated >>>> >>>> Thank you in advance >>>> Marcin. >>>> >>>> >>> >>> Clear your browser cache. This isn't a PHP problem. >>> >>> -- >> >> >> OK. But I cannot force every user and every visitor of my page to >> clear cache >> everytime they update photo. Is it possible to do it using some code? >> Maybe is it possible to implement this in JavaScript? >> >> M. >> >> > > > I`ve done this but in the other way: > > <img src="images/galeria/zdjecie.jpg?<?=time(); ?> > > It works > > Thank you in advance > Marcin > It will work, but it will eliminate all caching of the image by the client. The result can be a fair increase in required bandwidth, plus slower loading for the client. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
The Natural Philosopher wrote:
> Jerry Stuckle wrote: >> MZ wrote: >>> Hello all! >>> >>> I wrote a script to add or update photos no more than 50 KB size. >>> After adding photo I have possibility to update it (I mean change the >>> photo into the other one, so not adding another photo). After >>> updating I see still old photo, but this old photo is enlarged, I >>> mean that this old photo has sizes (widht & height) of a new photo >>> (just updated) but I still see this old photo, and not a new photo >>> just updated. >>> >>> This problem occurs in IE 7.0.. When I update photos in Firefox, >>> everything works fine. I can add, update photos and always I see >>> proper photos, that is I see new photos after updating them. >>> >>> I have such code: >>> >>> <? >>> function setExpires($expires) { >>> header( >>> 'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT'); >>> } >>> >>> setExpires(1); >>> header('Cache-Control: no-store, no-cache, must-revalidate'); >>> header('Cache-Control: post-check=0, pre-check=0', FALSE); >>> header('Pragma: no-cache'); >>> >>> include ("configuration.php"); //setting session_start() and other >>> things >>> >>> include ("gallery.php"); //script to add and update photos >>> >>> ?> >>> >>> and after above code I have such code: >>> >>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> >>> <HTML> >>> <HEAD> >>> <TITLE>Tytul</TITLE> >>> >>> >>> I have tried to change header() but it didn`t solve the problem. >>> >>> Please me. >>> Any apprieciated >>> >>> Thank you in advance >>> Marcin. >>> >>> >> >> Clear your browser cache. This isn't a PHP problem. >> > Yes. Is there a way to tell the browser to 'refresh this file everytime' > in the download? > No. All you can do is recommend. The browser is free to accept or reject the recommendation. Also, you can't do it for images without sending a custom header - which means a PHP script to serve the image. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
..oO(The Natural Philosopher)
>Yes. Is there a way to tell the browser to 'refresh this file everytime' >in the download? You don't want the browser to download it everytime, but instead to ask the server if the image was changed. Of course this requires proper HTTP headers to control the caching. For static images the server usually does this already (Apache servers for example send Last-Modified and ETag headers), but it also depends on the browser to respect them. Caching Tutorial http://www.mnot.net/cache_docs/ Micha |
|
![]() |
| Outils de la discussion | |
|
|