Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > best timing for clean the session variables

Reply
Thread Tools

best timing for clean the session variables

 
 
c676228
Guest
Posts: n/a
 
      04-26-2007
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
 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-27-2007
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.




 
Reply With Quote
 
 
 
 
c676228
Guest
Posts: n/a
 
      04-30-2007
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.
>
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual C++'s :"clean solution" doesn't clean the solution? plenty900@yahoo.com C++ 8 05-31-2008 04:57 PM
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
How do I clean a virus within an inbox or just clean only that infectedattachment or LOCATE AND delete just that attachment ? Vinayak Firefox 1 08-14-2006 06:19 PM
Clean up my Hard drive before selling it. Clean Registry? what else? baaab Computer Support 5 05-10-2005 08:30 AM
How long do Session variables last before timing out? Mark ASP .Net 1 07-08-2003 03:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57