Welcome Guest Search | Active Topics | Sign In | Register

Adding session variable slows down rendering Options
Loki
Posted: Wednesday, October 7, 2015 1:51:09 PM
Rank: Newbie
Groups: Member

Joined: 10/7/2015
Posts: 4
Hi there,

We are using EO pdf for our .net MVC4.5 project. We have a session variable Session["ScriptTimeout"] set with the current DateTime when the view is refreshed. The sole purpose of this is to change the version number to the reference of our JavaScript. (similar approach can be seen here)

When the user refresh, we check if it has passed 5 minutes from the time in the session variable.
If 5 minutes passed, we set Session["ScriptTimeout"] = DateTime.UtcNow.AddMinutes(5)
otherwise, we do nothing

We do not check the session variable when the user post to the print controller method.
Here's the problem:
As long as we assigned some value to the session variable, it took 2 minutes to render the pdf file.
Quote:
Session["ScriptTimeout"] = DateTime.UtcNow.AddMinutes(5);


When no session variable is set, everything goes under 10 seconds.

Please advice.
eo_support
Posted: Wednesday, October 7, 2015 1:58:18 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Do you use HtmlToPdf.ConvertHtml/ConvertUrl directly or MVC to PDF?

Thanks!
Loki
Posted: Wednesday, October 7, 2015 2:06:06 PM
Rank: Newbie
Groups: Member

Joined: 10/7/2015
Posts: 4
We are not using HtmlToPdf.ConvertHtml/ConvertUrl. Our view is rendered mainly using AngularJS. In both cases, the pdf file are rendered correctly.
eo_support
Posted: Wednesday, October 7, 2015 2:08:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

That's not what I am asking. You said you use EO.Pdf. My question is how do you use EO.Pdf? Do you use the MVCToPDF feature, or do you call HtmlToPdf.ConvertHtml/ConvertUrl directly from your code? What code do you use to call our library?

Thanks
Loki
Posted: Wednesday, October 7, 2015 2:13:56 PM
Rank: Newbie
Groups: Member

Joined: 10/7/2015
Posts: 4
We're using the MVCToPDF feature.

At the controller, we decorated the post method this way:

[RenderAsPDF]
[HttpPost]
public ActionResult PrintPdf(SomeDto printData){
// some EO pdf settings
....
return View("PdfView", printData);
}
eo_support
Posted: Wednesday, October 7, 2015 2:24:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Can you try to isolate the problem into a test project and send the test project to us? You can find more details here:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Loki
Posted: Wednesday, October 7, 2015 2:46:33 PM
Rank: Newbie
Groups: Member

Joined: 10/7/2015
Posts: 4
Hi there,

I've spent too much time trouble shoot this issue. Instead of session, I used cookie to get around it. I suspect that it could be related to the security verification.

Thanks for your time.

Regards,
Loki
eo_support
Posted: Wednesday, October 7, 2015 3:21:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
No problem. Please feel free to let us know if there is anything else.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.