473,320 Members | 1,814 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,320 software developers and data experts.

How to cache a streamed PDF

Hi,

I have an ASP.net application where I store PDFs in a database as binary
data. The web interface binary writes a specific PDF to the browser
based on user selections. Some of these PDFs are rather large, so it
would be nice if the client's browser would cache the file. However, I
haven't been able to make things work this way. Is there anything
specific that I can do? I'm thinking I might be able to change a few
things in the Response headers, but I'm not that familiar with them to
know. Any help would be greatly appreciated.
Mar 30 '06 #1
2 1009

I don't think you can cache byte streams.

You'd have to consider... writing the file out on the WEB SERVER, and giving
the user the hardcoded href.

Perhaps then... with a href, it might cache.

I don't know this as a fact for pdf's though.

Consider the use of GUID's for the filenames.

...
Of course, you then gotta clean up all those files.

"Kris" <wi*******@spam.gazeta.pl.invalid> wrote in message
news:e0**********@inews.gazeta.pl...
Hi,

I have an ASP.net application where I store PDFs in a database as binary
data. The web interface binary writes a specific PDF to the browser
based on user selections. Some of these PDFs are rather large, so it
would be nice if the client's browser would cache the file. However, I
haven't been able to make things work this way. Is there anything
specific that I can do? I'm thinking I might be able to change a few
things in the Response headers, but I'm not that familiar with them to
know. Any help would be greatly appreciated.

Mar 30 '06 #2
set the expiration header when you stream the pdf.

Response.Cache.SetExpires(DateTime.Now.AddDays(1)) ;

and the browser will cache it.

-- bruce (sqlwork.com)


"Kris" <wi*******@spam.gazeta.pl.invalid> wrote in message
news:e0**********@inews.gazeta.pl...
Hi,

I have an ASP.net application where I store PDFs in a database as binary
data. The web interface binary writes a specific PDF to the browser based
on user selections. Some of these PDFs are rather large, so it would be
nice if the client's browser would cache the file. However, I haven't
been able to make things work this way. Is there anything specific that I
can do? I'm thinking I might be able to change a few things in the
Response headers, but I'm not that familiar with them to know. Any help
would be greatly appreciated.

Mar 30 '06 #3

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

Similar topics

0
by: RandyB | last post by:
I wrote a web app that creates a Word XML file on the server. There is a "Word.Document" processing instruction in the XML to tell it that this XML should be handled by Word, not IE. But when a...
5
by: gregrjones | last post by:
I'm a musician who has a web site. I'd like to provide visitors of my web site with the means of streaming music off of my web site as one would if they were listening to a radio station. ...
0
by: Chris Hoare | last post by:
I am writing a prototype data collection application; teh data for this project is being streamed in from a TCP port. Example of the XM...
0
by: Randy | last post by:
Hi, is it possible (and how? ) to write an application, where I can get some informations like "artist" or "title" from a streamed file, which was played by a WindowsMediaPlayer ActiveX, which...
0
by: Neil Kimber | last post by:
Hi, I'm using the Cache object to persist some values between pages. I'm setting the expiration for 2 minutes. I'm actually storing Bitmap streams in the cache. In this way, one page can draw an...
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...
0
by: =?Utf-8?B?TWFya3VzU3Ryb2Js?= | last post by:
Hi! I'm currently developing a file upload and -downloadservice based on wcf. As the files transfered are very large (~300MB) i decided to use the streamed transfer mode. The communication...
7
by: Paulo | last post by:
Hi, how do I force the asp to read the imgs files on server without making changings on IE settings like checking: Every visit on page...? Any hint? any classic asp code line? Thanks!
3
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
Note: My apologies for repeating this post from last week, but my nospam alias and profile account were incorrect. I think I have fixed this, so hopefully this post will trigger MS into a response...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.