473,414 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

clearing the cache also image is not refreshed

30
hi,
i have a problem.
i am saving bitmaptextimage dynamically in data/image1.jpg every time when i redirect to the image.aspx page and i am assignning this image url to the image control.but image is not refreshing.if we press F5 or REFRESH button then image is refreshing.
i have used following techniques

Expand|Select|Wrap|Line Numbers
  1. Response.Cache.SetCacheability(HttpCacheability.NoCache);
  2. Response.Cache.SetExpires(DateTime.Now-new TimeSpan(1,0,0));
  3. Response.Cache.SetLastModified(DateTime.Now);        
  4. Response.Cache.SetAllowResponseInBrowserHistory(false);
  5.  
  6. <%@ OutputCache Duration="1" VaryByParam="None" %>
  7.  
  8. <meta http-equiv="refresh" 
  9. content="[n];url=http://www.microsoft.com/pagename.htm">
reply me please
Nov 30 '07 #1
6 1798
kenobewan
4,871 Expert 4TB
OutputCache location="none". HTH.
Nov 30 '07 #2
Plater
7,872 Expert 4TB
I've had good luck with
Expand|Select|Wrap|Line Numbers
  1. Response.Cache.SetNoStore();
  2.  
But you would need a way to set that header for the image request too.
Nov 30 '07 #3
Frinavale
9,735 Expert Mod 8TB
I know this problem!
I had it a few months back.
I had to dynamically retrieve an image from a database and show it to the user based on their account...I allowed them to update this image and I was stuck with the old one displaying.......

Here's what happened:
I gave the image a name when I grabbed the image from the database and stored it temporarily in the folder where the web server could retrieve it...so it could be displayed in the web browser.

Every time this happens, the image is named the same thing (based on the user's login properties).

The browser grabbed that image and cached the image.
When the browser came back to the page, the old image would always appear because the browser didn't download the new image.

So to get around this problem I appended random numbers to the image name...forcing the browser to download the new image.


The meta tag that indicates "no-cache" did not help resolve this issue because this tag is used by ASP.NET, not your web browser.

It allows the ASP.NET technology to determine whether or not a cached version of the compiled ASP code should be used...

Setting this meta tag to "no-cache" indicates to the ASP.NET technology that the ASP code should be compiled every web-request.

I could be wrong about this...but I'm almost 100% sure.
Nov 30 '07 #4
Plater
7,872 Expert 4TB
Instead of writing a lot of temporary files, you could also create a serve-up page that responds back with "content-type: jpeg" and the jpeg data.
I use that for certain situations, helps control security a little better.
Nov 30 '07 #5
Frinavale
9,735 Expert Mod 8TB
Instead of writing a lot of temporary files, you could also create a serve-up page that responds back with "content-type: jpeg" and the jpeg data.
I use that for certain situations, helps control security a little better.
Or you could overwrite the old jpegs with new :D
Nov 30 '07 #6
Plater
7,872 Expert 4TB
Or you could overwrite the old jpegs with new :D
My file system does not allow write access to the webservice for any of it's directories contained withen itself. So writing a bunch of temporary files that are available to the outside world through http is not permsible.
Just an alternative :-P
Nov 30 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bill Puetz | last post by:
I have a form with 4 different Submit buttons. In the action code, I do a request on the button names to see which one is valued. This all works great, until the browser is refreshed -- the...
0
by: Micha³ Januszczyk | last post by:
is there any way to tell whether the application has entered the shutdown state ? I put some data into aspnet cache. Special callback method is specified that should be called when cache item is...
6
by: Charts | last post by:
I used HttpContext.Current.Cache To cache data from database. The code is like that. public static DataView GetCategories() { if ( HttpContext.Current.Cache == null ) {...
6
by: JJ_377 | last post by:
In a "Save and Quit" button on my web app form (aspx), I have the following code that is supposed to clear a session variable (an user id) and redirect to a logon page: Session.Clear()...
0
by: PD | last post by:
I am trying to stream out a PDF file via the response object and when I execute the code it always brings up the first document that I pulled up.Even when I step through the code, I can see the new...
7
by: Jake Barnes | last post by:
I've a little webcam program that snaps a picture of me and uploads it every 20 seconds. It automatically uploads the image to my server. It always give the image the same name, and thus it...
0
by: negmat | last post by:
Hello everyone, I have the following question: I am aware that the objects currently in the cache can be viewed by issuing the following command: SELECT * FROM master.dbo.Syscacheobjects ...
3
by: wardemon | last post by:
Hi All, I have a aspx page named: ImageProcess.aspx that creates a thumbnail version of an image by passing the ImagePath, width, and height. The ImagePath is taken from a table from a database,...
0
by: Nizha | last post by:
Hi, The browser cache is not getting clearing inspite of setting these headers.. <% response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache");...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.