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

best timing for clean the session variables

Hi all,
I usually clean the session when the result page is presented to the user.
At this time, say an email confirmation was sent to the user and a pdf file
they can becdownloaded from the result page.
But if the user click the refresh or back button etc. for some reasons, they
pdf file is not available since it created on the fly when the request was
submitted.
So I am thinking about pull pdf file from database, but don't want the
database being hitted everytime the refresh button was clicked or the
requested is resubmitted.
Do you have a simple cache trick in this case?
Thank you.
--
Betty
Apr 26 '07 #1
2 1969
Hi Betty,

From your description, your ASP page will dynamically generate some PDF
document and write out it to client user based on their submited request.
Currently, you're wondering any good means to reuse those document(without
regenerate or connect database) when the user refreshing or resubmit the
page, correct?

Based on my experience, for such caching functionality in classic ASP, we
have two obvious approachs:

1. use a temp folder to store those temporarily generated pdf files. And
after user submit a request and the PDF got generated, instead of directly
write out the pdf stream in the same request's response stream. You can use
response.redirect to redirect the user to another page(with parameters
indicate which temp pdf stream need to write out), then the user will
always get pdf stream through that particular page. And you can use a
background program to constantly monitor and clean up the temp folder based
on file's creation/modify datetime. And for client user, if they refresh
the page or resubmit same request, you can first check cached temp file, if
exists, directly flush out the cached temp pdf stream.

2. the code logic is the same as #1, however, instead of using a temp file
folder, you can use a temp database/table to store the temporarly generated
PDF stream.

How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Apr 27 '07 #2
thank you, Steven, for your suggestion. That's definitely dorable
--
Betty
"Steven Cheng[MSFT]" wrote:
Hi Betty,

From your description, your ASP page will dynamically generate some PDF
document and write out it to client user based on their submited request.
Currently, you're wondering any good means to reuse those document(without
regenerate or connect database) when the user refreshing or resubmit the
page, correct?

Based on my experience, for such caching functionality in classic ASP, we
have two obvious approachs:

1. use a temp folder to store those temporarily generated pdf files. And
after user submit a request and the PDF got generated, instead of directly
write out the pdf stream in the same request's response stream. You can use
response.redirect to redirect the user to another page(with parameters
indicate which temp pdf stream need to write out), then the user will
always get pdf stream through that particular page. And you can use a
background program to constantly monitor and clean up the temp folder based
on file's creation/modify datetime. And for client user, if they refresh
the page or resubmit same request, you can first check cached temp file, if
exists, directly flush out the cached temp pdf stream.

2. the code logic is the same as #1, however, instead of using a temp file
folder, you can use a temp database/table to store the temporarly generated
PDF stream.

How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Apr 30 '07 #3

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

Similar topics

1
by: Mark | last post by:
How long do Session variables last before timing out? What is the default value? Can it be changed? Thanks! Mark
1
by: Don | last post by:
When we redirect a user to a new page, we generally want the processing of the current page to end right then. As I understand it, the runtime accomplishes this by generating a ThreadAbort...
1
by: Dean Richardson | last post by:
Hello, I am having problems with my PHP sessions timing out. I have a system which requires the user to login. Once they login, it then stores their username as a session variable and is checked...
4
by: Nebulus | last post by:
We've got a website that's designed in classic ASP. While it's a good product, the original design was badly done, and I've inherited a monster. At some point last week, users began calling in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...

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.