Hi,
I have a site were the pages are dynamically generated on demand.
These pages like any static html page may contain image tags and
references to CSS files.
All the images and CSS files etc... are stored in a database so in the
HTML produced for the page the source of an image, for example,
might be:
src=http://www.mysite.com/Res/3/logo.gif
The DLL that runs my site contains a HttpModule that parses each
request when it sees a URL with Res/X/filename in it it extracts the
number X and uses it and the filename to lookup the data in the
database and then does a Response.Write or Response.Binary Write
depending on the type of data.
Before it actually writes the data back to the browser it:
With Response
.Expires = 0
.Buffer = True
.Clear()
.AddHeader("Las t-modified",..... .)
.ContentType = Ctype(....., string)
.Cache.SetCache ability(HttpCac heability.Publi c)
.AddHeader("con tent-disposition", "filename=" & ....)
.... the decisision of either .Write or .BinaryWrite
End With
However I can see when running through VS.NET that each
time the you visit the page the images etc... are reloaded.
This makes it even worse when you try to load JS to preload
images for roll-over effects, as this JS actually has no effect
and both over and off images a reloaded everytime.
Anybody have any ideas?
Regards,
Peter 2 2163
You set Expires to 0, which will cause the browser to request the image from
the server every time.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Peter Row" <pe*******@oxfo rdcc.co.uk> wrote in message
news:Os******** ******@TK2MSFTN GP11.phx.gbl... Hi,
I have a site were the pages are dynamically generated on demand. These pages like any static html page may contain image tags and references to CSS files.
All the images and CSS files etc... are stored in a database so in the HTML produced for the page the source of an image, for example, might be: src=http://www.mysite.com/Res/3/logo.gif
The DLL that runs my site contains a HttpModule that parses each request when it sees a URL with Res/X/filename in it it extracts the number X and uses it and the filename to lookup the data in the database and then does a Response.Write or Response.Binary Write depending on the type of data.
Before it actually writes the data back to the browser it:
With Response .Expires = 0 .Buffer = True .Clear() .AddHeader("Las t-modified",..... .) .ContentType = Ctype(....., string) .Cache.SetCache ability(HttpCac heability.Publi c) .AddHeader("con tent-disposition", "filename=" & ....)
.... the decisision of either .Write or .BinaryWrite End With
However I can see when running through VS.NET that each time the you visit the page the images etc... are reloaded. This makes it even worse when you try to load JS to preload images for roll-over effects, as this JS actually has no effect and both over and off images a reloaded everytime.
Anybody have any ideas?
Regards, Peter
Hi,
Doh!
Yes that's right, plus I hadn't upgraded the code to use the prefered
Cache object property instead of the compatibility property Expires.
This was a porting job from VB6 webclasses.
Thanks for the reply,
Regards,
Peter
"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:eh******** ******@TK2MSFTN GP12.phx.gbl... You set Expires to 0, which will cause the browser to request the image
from the server every time.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Peter Row" <pe*******@oxfo rdcc.co.uk> wrote in message news:Os******** ******@TK2MSFTN GP11.phx.gbl... Hi,
I have a site were the pages are dynamically generated on demand. These pages like any static html page may contain image tags and references to CSS files.
All the images and CSS files etc... are stored in a database so in the HTML produced for the page the source of an image, for example, might be: src=http://www.mysite.com/Res/3/logo.gif
The DLL that runs my site contains a HttpModule that parses each request when it sees a URL with Res/X/filename in it it extracts the number X and uses it and the filename to lookup the data in the database and then does a Response.Write or Response.Binary Write depending on the type of data.
Before it actually writes the data back to the browser it:
With Response .Expires = 0 .Buffer = True .Clear() .AddHeader("Las t-modified",..... .) .ContentType = Ctype(....., string) .Cache.SetCache ability(HttpCac heability.Publi c) .AddHeader("con tent-disposition", "filename=" & ....)
.... the decisision of either .Write or .BinaryWrite End With
However I can see when running through VS.NET that each time the you visit the page the images etc... are reloaded. This makes it even worse when you try to load JS to preload images for roll-over effects, as this JS actually has no effect and both over and off images a reloaded everytime.
Anybody have any ideas?
Regards, Peter
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tony Marston |
last post by:
If the use of the browser's BACK button is interfering with the operation of
your web application then take a look at this article entitle "Back Button
Blues"
http://www.tonymarston.co.uk/php-mysql/backbuttonblues.html
--
Tony Marston
http://www.tonymarston.net
|
by: Cyrus D. |
last post by:
Hi guys,
Let's say I have a page that is primarily HTML but I added a few small parts
that are PHP, for example a random banner. The page is in no way PHP driven,
it just has some some random stuff like the banner and/or a tip of the day.
What bothers me is that the PHP page won't be cached, so if the page has a
lot of links and, on average, the user clicks ten links (hitting the back
button after he does that) my bandwidth usage...
|
by: Peter Row |
last post by:
Hi,
I have a site were the pages are dynamically generated on demand.
These pages like any static html page may contain image tags and
references to CSS files.
All the images and CSS files etc... are stored in a database so in the
HTML produced for the page the source of an image, for example,
might be:
src=http://www.mysite.com/Res/3/logo.gif
|
by: Charlie |
last post by:
Hi:
When I change an image, but keep same title, then upload image to hosting
server, my browser will display old image until I refresh. If I close
browser, then open same page again, I have to refresh again to view new
image. It's not until I have done this a few times will get new image
without refreshing. Seems like browser is somehow holding on to old image.
Anyone know what causes this and how to prevent it?
Thanks,
|
by: Haydnw |
last post by:
Hi,
I have the code below as code-behind for a page which displays two images.
My problem is with the second bit of code, commented as " 'Portfolio image
section". Basically, the SQL query gets details of a random image from an
access database. I know this works because when I run the query in access,
it picks a different image each time (or close enough). However, when I view
the .aspx page that this code-behind is for, it always picks...
| |
by: WRH |
last post by:
Hello
I am new to asp but I made some Jscript functions which work
fine. The functions contain some strings used as a registration
key for some apps. It is important that these strings not be
visible to a client using a browser. My question is...can a
knowledgeable browser user view Jscript source code in an asp file?
|
by: Joe Fallon |
last post by:
I have a page in ASP.Net 1.1 which contains an image control.
I set the ImageUrl property = "MyImageViewerPage.aspx"
This page acts as an image handler. I have an array of bytes which I send to
the browser using BinaryWrite.
e.g. Response.ContentType = mVar.contenttype
Response.BinaryWrite(mVar.MyBytes)
|
by: emer.kurbegovic |
last post by:
Is it possible to cache dynamic images in client's browser the same way
static images are cached?
for example, i'd like to be able to cache this dynamic image: <img
src=pic.axd?id=2the same way the browser would cache it if it would
say <img src=http://someplace.com/pic.jpg>
is this possible? if not, what are my choices/alternatives?
thanks in advance,
|
by: etnaelk |
last post by:
Hi all, I have a real bugger of a problem that I just haven't been able to figure
out. I am working on writing my own proxy server in C# using TcpListener,
TcpClient, HttpWebRequest/Response and NetworkStream. I have everything
working pretty well except images won't load to their location.
------------------------------------------------------------------------------------------------------------------...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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,...
|
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...
|
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| | |