473,769 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to keep XSLs in Memory?

Hello,

I'm working on a project that uses over a hundred XLSs for transforming xml
documents. The project consists of several webservices (IIS) calling a few
dlls. This dlls make the business logic and are the ones that do the
transformation, so the XLSs are used by these dlls. Right now we have the
XSLs files on hard disk. This means there is lots of reading from disk. Since
reading from disk is much slower than reading from memory I am looking for a
way to keep them in memory.
Any Ideas?
Will IIS cache them? How? (Keep in mind they are used by the dlls)

I also was thinking simple work around. Using a RAM Disk, but it seems
Windows 2003 server does not support RAM Disks.

Any help?

Thanks.

Nov 12 '05
15 2183
I am not really a fan of using third-party software but thanks any way for
the tip.

"Ross Presser" wrote:
On Mon, 21 Mar 2005 06:59:04 -0800, Alexis wrote:
I also was thinking simple work around. Using a RAM Disk, but it seems
Windows 2003 server does not support RAM Disks.


There's no RAM disk driver *shipped* with Windows 2000 and above, but there
are many third-party RAM disk drivers available that will work. Seek (on
Google) and ye shall find.

Nov 12 '05 #11
On Thu, 24 Mar 2005 07:07:03 -0800, Alexis wrote:
I have not have time to try it yet but it make a lot of sense. I was just
wondering how efficient it may be. The whole purpose of keeping the XSL files
or objects in memory is to improve performance. Do you know if accessing the
HttpContext from a dll will have some impact on performance?


Well, the thing of it is, where do you expect the DLL to cache it? You need
something that has persistence between invocations of your DLL, and the
easiest answer to that is to let ASP.NET handle it. And the way to access
ASP.NET's cache is through HttpContext.Cur rent.

I could be wrong about this, and you might want to check the other dotnet
newsgroups for a more informed opinion.
Nov 12 '05 #12
What I want to keep in memory are XSLs files used for transformation not the
data so the contenct don't change, but I don't think ASP.NET will cache XSL
files. See my original goal is to keep XSL files in memory instead of having
to read them from disk on every request

"Ross Presser" wrote:
On Thu, 24 Mar 2005 07:07:03 -0800, Alexis wrote:
I have not have time to try it yet but it make a lot of sense. I was just
wondering how efficient it may be. The whole purpose of keeping the XSL files
or objects in memory is to improve performance. Do you know if accessing the
HttpContext from a dll will have some impact on performance?


Well, the thing of it is, where do you expect the DLL to cache it? You need
something that has persistence between invocations of your DLL, and the
easiest answer to that is to let ASP.NET handle it. And the way to access
ASP.NET's cache is through HttpContext.Cur rent.

I could be wrong about this, and you might want to check the other dotnet
newsgroups for a more informed opinion.

Nov 12 '05 #13
On Fri, 25 Mar 2005 07:27:03 -0800, Alexis wrote:
What I want to keep in memory are XSLs files used for transformation not the
data so the contenct don't change, but I don't think ASP.NET will cache XSL
files. See my original goal is to keep XSL files in memory instead of having
to read them from disk on every request


ASP.NET's Application object, or Cache object, will cache ANY object, with
whatever expiration/retention rules you care to set up.
Nov 12 '05 #14
I would like to try to cache the xsl objects them.
Can you provide me with a code sample? I have not used cahing in yet.

"Ross Presser" wrote:
On Fri, 25 Mar 2005 07:27:03 -0800, Alexis wrote:
What I want to keep in memory are XSLs files used for transformation not the
data so the contenct don't change, but I don't think ASP.NET will cache XSL
files. See my original goal is to keep XSL files in memory instead of having
to read them from disk on every request


ASP.NET's Application object, or Cache object, will cache ANY object, with
whatever expiration/retention rules you care to set up.

Nov 12 '05 #15
On Wed, 30 Mar 2005 07:05:07 -0800, Alexis wrote:
I would like to try to cache the xsl objects them.
Can you provide me with a code sample? I have not used cahing in yet.


Hope you don't mind VB.NET ...

' this function will look in the ASP.NET cache for an XSLTransform;
' if it's there, it will return it;
' if it's not, it will call CreateTheXSLT() to create it.
Public Function GetXSLTObject(B yVal key As String) _
As System.Xml.Xsl. XslTransform
' get a handle to the ASP.NET cache
Dim c As Web.Caching.Cac he
c = HttpContext.Cur rent.Cache

Dim x As System.Xml.Xsl. XslTransform
If c.Item(key) Is Nothing Then
' it wasn't in the cache ...
' create it fresh, then put it in the cache
x = CreateTheXSLT(k ey)
' sliding expiration of 2 hrs ...
' if we don't use it for 2 hrs, ASP.NET is allowed to
' purge it from the cache
c.Add(key, x, Nothing, Nothing, _
System.TimeSpan .FromHours(2), _
Caching.CacheIt emPriority.Norm al, _
Nothing)
Return x
Else
' yaay, it was in the cache ... return it
x = c.Item(key)
Return x
End If

End Function
Nov 12 '05 #16

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

Similar topics

0
1445
by: Zillian | last post by:
Dear XML chiefs, I have two questions: * How many XSLs do you use for your websites? Is it better to split big Stylesheets in smaller ones (does it speed up the transformation to html?) What is the limit in lines you would recommend? * How many tags do you use? Is it better to use many or few tags?
7
7173
by: Clement | last post by:
hi, i have an asp.net site and is using SQL Server 2k. i realize the aspnet_wp.exe memory usage keep growing and i will receive an error for the pages that call the sql connection. others page with no sql connection is fined. At the time when i encounter the error, i check the memory usage for aspnet_wp.exe = 60000kb sqlmangr.exe = 40000kb
0
807
by: Alexis | last post by:
Hello, I'm working on a project that uses over a hundred XLSs for transforming xml documents. The project consists of several webservices (IIS) calling a few dlls. This dlls make the business logic and are the ones that do the transformation, so the XLSs are used by these dlls. Right now we have the XSLs files on hard disk. This means there is lots of reading from disk. Since reading from disk is much slower than reading from memory I am...
3
1686
by: patrickbeaudoin | last post by:
Hi, I have some application that use the same library in the gac. All these application use the same xml document. I would like to keep that xml document loaded in memoy and dont have to reload it all the time. Same thing for a XslCompileTransform object. It seems to be recompiles each time I use It... I would like to keep it loaded after it has been loaded once.
11
9307
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1, y1, x2, y2); }
7
7227
by: mail747097 | last post by:
I would like to keep IIS alive on my web site and prevent Application_End from occuring in global.asax. Any ideas?
4
5806
by: Daniel | last post by:
is there some per-process-limit on memory in .net processes? is there any way to increase it? i keep getting System.OutOfMemoryException when my box has 8 gigs of unused memory.
1
2308
by: =?Utf-8?B?QWxwaGFwYWdl?= | last post by:
Hello, I have built an object which does some jobs on a particular server. There can have lots of this object running concurrently. I want to know what is the best way to optimize my application: - keep all those objects alive in memory without any timeout (the object is built one time per user, then disposed when the user exits). - as I can rebuild the object, I can build the object, execute the job once, then dispose this object each...
6
2717
by: Guillermo | last post by:
Hi, I need a script to keep running in the background after it's loaded some data. It will make this data available to the main program in the form of a dictionary, but I don't want to reload the calculated data every time the user needs it via the main program. I won't be working with an UI, hope that can be made easily in Python somehow.
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10047
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 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...
1
9995
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,...
0
9863
tracyyun
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...
0
5304
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...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
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...

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.