Classic ASP, Future, Past, Future and Cache - Performance Management
Classic ASP (Active Server Pages) is a server-side scripting technology developed by Microsoft and introduced in the mid-1990s. It is used to dynamically create web pages and perform server-side operations.
Classic ASP is a technology that preceded ASP.NET and is now considered obsolete. Classic ASP can perform operations such as database access, session management and performing operations on forms by using VBScript or JScript codes running on the server side on web pages. It runs on the IIS (Internet Information Services) server and is mostly written in VBScript.
However, today Classic ASP is considered an old and outdated technology. More powerful, secure and scalable, ASP.NET is Microsoft's modern web application development platform. ASP.NET works with the .NET Framework and .NET Core (now .NET 5 and above) and supports languages such as C# and VB.NET. In new projects, it would be more appropriate to use ASP.NET or other modern web technologies (Node.js, Django, Flask, Ruby on Rails, etc.) instead of Classic ASP. Although Classic ASP is an old technology, some methods can be applied to improve performance. Here are some tips to improve performance in Classic ASP:
Classic ASP Performance Optimization
- Classic ASP (Active Server Pages) is a server-side scripting technology developed by Microsoft and introduced in the mid-1990s. It is used to dynamically create web pages and perform server-side operations. Avoid unnecessary loops and processes to reduce processing time and conserve server resources.
- Optimize database connections: You can achieve better performance by optimizing database connections and queries. Close connections and Recordset objects immediately after use.
- Optimize database queries: For queries of tables with a lot of data in them, select only the fields that are really needed and narrow queries using WHERE conditions whenever possible.
- Cache usage: As mentioned earlier, you can cache page content and frequently used data to prevent the server from doing the same thing over and over again.
- Use client-side technologies: Whenever possible, use client-side technologies such as JavaScript to move the workload from the server to the browser.
- HTML and CSS optimizations: Remove unnecessary HTML and CSS code to reduce the size of web pages. You can also reduce page load times by using appropriate compression and sizing methods for images and other media files.
- Optimize on-page components: By combining and minifying JavaScript and CSS files, you can ensure fewer HTTP requests are made. This helps browsers load pages faster.
- Handle Application and Session objects carefully: In Classic ASP, Application and Session objects use server resources. Use these objects only when really necessary and efficiently.
---- I will create detailed articles for all the above topics separately.
Although you can apply these tips to improve performance, you will be able to achieve higher performance by using a more modern language and technology. In particular, newer generation technologies such as ASP.NET offer more advantages in performance and scalability than Classic ASP. Here are other tips you can apply to improve performance in Classic ASP:
- Use database indexing: Use appropriate indexes on database tables to improve query performance. This will help retrieve data quickly and make queries run faster.
- Use asynchronous transactions: Asynchronous transactions can reduce page load times by running in parallel between server and client. You can perform asynchronous operations in Classic ASP with XMLHTTP or another AJAX technology.
- Use built-in functions whenever possible: In Classic ASP, built-in functions are usually faster than custom-written functions. Use built-in functions whenever possible to improve performance.
- Write secure code: A good and secure application is important for performance. Apply secure coding techniques to prevent vulnerabilities such as SQL injection and XSS attacks.
- Optimize server configuration: By optimizing the configuration of the IIS server, you can improve the performance of your Classic ASP application. For example, by adjusting the run processes, session times, and cache configuration.
Remember that Classic ASP is an old technology and is limited in performance to meet the requirements of modern web applications. For new projects, it is important to opt for more modern and performant technologies, but no matter which software language you use, if you code in the right, planned and proper way, it will run very stable. It may take more effort than the next generation programming languages, but that doesn't mean it can't cope with the next generation software languages.
Perhaps the most serious problem is the effort it takes to dynamically generate and deliver the content of a web page dynamically (request - repsonse). Think of it this way, as soon as an address is typed in, the page that will appear in front of you performs hundreds, maybe thousands of operations, and the process is the process of kneading the final page that appears as HTML, consisting of combinations offered by the designer, software developer and content producer. Dozens of parameters such as site setting information, content titles, perhaps the selection of related content, side menus, footer information, a large mega menu content, etc. are done over and over and over again after each query request.
But there is such a situation that perhaps many of these repetitive operations return the same result for hours, days or weeks. At this point, it is possible to make a static copy of these results, which can be accessed quickly and rewritten in the relevant field during requests in a simpler way, perhaps free of SQL queries. If when I say this, you think of taking an HTML output and keeping it in a Session object, you have read this article in vain. The Session object is like a personal locker that only that user can access in each user session. Isn't it a bit cumbersome to make and store a copy of the same data for each user over and over again? Then there should be a common locker that every user can access? The Application Object! Yes, the Application Object is a space accessed by all users. Therefore, storing 1 data here is more performant than storing it separately for 1000 users. It is also possible to store data as a physical file, rather than as objects kept in Memory like Application and Session objects.
The most important thing to consider here is the duration of the data you store. For example, if a homepage is updated twice a day, it may be efficient to keep the data of that page in 6-hour caches. Or, recreating and updating the relevant caches when an update is made can also contribute to performance.We will see an example code for the Physical Caching method:
Physical Caching Sample Code Structure
This code allows you to statically, physically cache specific content. But you may ask, how do I cache a whole page? At this point, what you need to do is to create an XMLHTTPRequest, extract the full address of that page from your server, and save the HTML code with the `SetCacheFile` method.
Thanks for reading.
https://www.bulbapp.io/p/afc3ba73-c41e-4eea-bba3-286afd3b15aa/how-video-games-affect-brain-functions
https://www.bulbapp.io/p/8977dcea-8ef1-440c-a0c9-f386436e67cc/10-interesting-facts-about-your-heart
https://www.bulbapp.io/p/ed781ba0-c6f8-482f-afa6-ac9245a3317e/building-a-business-model-playing-to-win
https://www.bulbapp.io/p/54e3660a-c479-4bc9-91b7-b7b3d3c0e71a/a-high-school-chemistry-teacher-turns-into-a-drug-trafficking-emperor-breaking-bad
https://www.bulbapp.io/p/326f592e-cb75-4058-b0a2-343e11b5bcab/9-car-rental-tricks-to-save-you-money
https://www.bulbapp.io/p/2cfd5d21-0ba7-4e6e-ac55-a34e07e7b5ac/anxiety-or-depression-discover-the-differences-in-mental-health-and-step-into-a-happy-life
https://www.bulbapp.io/p/004b0940-6955-4820-a9de-e467786681b0/how-to-become-a-comic-book-writer
https://www.bulbapp.io/p/7d7d7c18-ff92-4961-9649-a5fa1c93225b/movie-analysis-fight-club
https://www.bulbapp.io/p/3f44c30b-0594-4463-96b2-5efe8f2474e5/5-things-everyone-knows-wrong-about-cleopatra
https://www.bulbapp.io/p/e61d9c7e-e817-4b4b-8691-9ef8d7c89050/what-is-virtual-reality-most-successful-vr-glasses
https://www.bulbapp.io/p/0c7a4689-ba03-4671-a3c8-a071a8926431/common-characteristics-of-people-over-100
https://www.bulbapp.io/p/65d9d434-98a1-47be-ab6f-e209d761b73b/the-roman-art-of-war-35-critical-suggestions-of-vegetius
https://www.bulbapp.io/p/6b0a440e-9314-4f53-ba59-d8d69cc61417/who-is-ramses-2-
https://www.bulbapp.io/p/f592c6f2-df56-4a4d-a0cc-cf11a5016296/what-is-phubbing
https://www.bulbapp.io/p/cec8c1c2-ee60-4296-ade7-f07e2bbe3735/what-is-matrix
https://www.bulbapp.io/p/6627addf-a999-4712-94af-1a41466f45e9/protect-your-credit-card-by-changing-this-iphone-setting