473,799 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem in refresh

Hello experts

I have this question which confuse me! so please help me

Is there a difference between clicking on the refresh button in the
browser and writing this command: "window.locatio n.reload()"

(in the meaning of loading images on a page)

The problem that I'm facing is as following:
my page uses an image to display, I wrote a code in php to change some
pixels of that image and save it with the same name, now I need to
redownload this image again in my page so I wrote the statment
"window.locatio n.reload()" but it surprised me that the result dosen't
appear unless I clicked mannually on the "refresh" button.
It seems that the old image is preloaded in cache or such thing? and
it's reloading again and again?

I tried to use the meta tag "no-cache" but with no good!

Jul 1 '06 #1
2 1479
Message-ID: <11************ **********@v61g 2000cwv.googleg roups.com> from
ma*****@hotmail .com contained the following:
It seems that the old image is preloaded in cache or such thing? and
it's reloading again and again?

I tried to use the meta tag "no-cache" but with no good!


Stop the caching by adding a random number after the image e.g.

<img src="myimage.jp g?rand=randomnu mber">

where 'randomnumber' changes each time.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 1 '06 #2
ma*****@hotmail .com:
Is there a difference between clicking on the refresh button in the
browser and writing this command: "window.locatio n.reload()"
Could be. At the HTTP level the relevant difference is between a
conditional and an unconditional GET. What a browser's Refresh
function does and what window.location .reload() does depends on the
browser and its implementation of the scripting language, neither of
which is on-topic here. I would guess window.location .reload(true)
would generally produce an unconditional GET.
(in the meaning of loading images on a page)

The problem that I'm facing is as following:
my page uses an image to display, I wrote a code in php to change some
pixels of that image and save it with the same name, now I need to
redownload this image again in my page so I wrote the statment
"window.locatio n.reload()" but it surprised me that the result dosen't
appear unless I clicked mannually on the "refresh" button.
It seems that the old image is preloaded in cache or such thing? and
it's reloading again and again?
Sounds right.
I tried to use the meta tag "no-cache" but with no good!


Cache directives in METAs, if they're taken into account at all,
affect the document itself, not any images (or other resources)
referred to in that document. You would normally specify cache
directives for images in their own HTTP response headers.

If you have an image which changes either regularly or frequently,
and it remains conceptually the same image, you would keep it on a
tight reign, that is, specify short expiration times. That way, when
it does change, browsers re-request it rather than pull it from caches.
If, on the other hand, it is conceptually a different image, I would
rename it (you would then have to keep the document that references the
image on a tight reign).

Mark Nottingham's tutorialish page is the recommended reading.

--
Jock

Jul 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1182
by: Mvk | last post by:
Hello; I have a strange threading problem. Suppose I have the following subs in it: 1) Refresh() 2)
0
1730
by: brian lanning | last post by:
As a public service, I'm posting the solution to a problem I had. The bizarre thing is that I think this should have created an error. Instead, it sort of worked, but not quite. Many are familiar with this line: <meta http-equiv="refresh"; content="10";url="DataForm.aspx"> Instead, I inadvertently made it look like this: <meta http-equiv="refresh" content='10;url="DataForm.aspx"'>
10
9251
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side click event and I update session information to track the visibilty of some panels in a wizard type navigation ("Next >>" and "<< Back" buttons).. but the refresh button makes another event firing and takes the whole thing to a Choes.. ...
1
3370
by: ppatel | last post by:
Problem I have a problem with web image button control click event. The click event does not get trigger until it has not been clicked once or page refresh occures(which is fine). When click event fires first time it executes code associate with click event(As I expected). the problem is when you refresh page it fires a click event automatically. I looked around many posts and did not find any topics about this problem. Infact the same...
17
5218
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be running continuously and refreshing once an hour. I there set timeout= 61 in <sessionState section and on my page it says <meta http-equiv="refresh" content="3600">. I also set timeout=120 in the <forms section of web.config to make sure
6
2510
by: Doug | last post by:
I'm about to go nuts. I've got a VB.NET web app , utilizing frames(my 1st mistake). One of the frames is hidden and does a behind the scenes refresh, to keep the session alive. This works great with IIS 5.0, but when I port it to IIS 6.0. The refresh does not reset the session. The only thing that will work on the IIS 6.0 server, is to refresh the ENTIRE frameset. This is not an option. Is there anything I can do to the code, or...
12
2301
by: Justin | last post by:
I can attach my code if anyone wants to see it however I'll try to ask my question with some mark up code first. I'm having a problem terminating my process while using DoEvents. For example: Button.text = start If button.text = start then button.text = stop
0
2151
by: grappeggia | last post by:
Hi everybody, I`m doing a project in which a microcontroller realises an A/D conversion of 8 channels and send then to the computer using the USB, over one serialport interface. On the PC, I`m using a VB software that receives and store the data from the microcontroller. On this program, the user enters with the sampling time and the name of the storage file. So, to start the pickup, the user must click on the "Coletar" button. Then the...
10
4408
by: amitabh.mehra | last post by:
Hi I havent used MQT before. Read the online tips and tutorials but none seems to give any hint for my problem. I have a base table (base_table) as: st varchar(25) default 'my_null' dt timestamp default '1900-01-01-00.00.00.00000'
22
3834
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script to hello.php file: <html> <head> <title>PHP Test</title>
0
10482
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10225
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.