my website is speeding down due to delay in response from my Redirect301 URLs which i have saved in a table. Whenever any URL of my website is accessed, first i search OLD Url from Redirect301 table containg 1939 rows, this matching is slowing down my website. Maximum lenght of URL in OldURl column is 129 characters Average visit of my site is 1000 visits per day.
How i can speed up my website ? Please provide a solution or suggest any one of the following options.
Option 1. By placing this table in a DataTable, and cache this it in memory?
Option 2. By computing hashcode of OLD URL, and then compute HashCode of accessed URL, match it with OLDURL Column and redirect to NEW URL ? but GetHashCode() always does not generates same value , and also two different strings can have same HashCode... please refer to below three URLs
Can I Use GetHashCode for All string Compares
C Sharp - Equals and GetHashCode
Guidelines and Rules For GetHashCode
WebServer: IIS7
Database MS SQL Server 2005. Full Text Indexing and searching is installed and working
Option 3. By Computing MD5 Hash according to Option 2?
Option 4. Apply full text index and use Contains to match record.
Select NewURL from Redirec301 where contains(OLDURL,"http://www.MySite.Com/OLD-URL")
Thanks and Best Regards
Redirect301 Table Of My Database:
Redirect301 Table Structure Details: