Frustrating day...
Yesterday was quite a frustrating day.
One of our main goals with our .NET migration is to take advantage of the majority of the new features, of course. The main being caching. In our current form, we do quite a bit of caching - when you do a search on Match, currently, your first search hits the database and is then serialized to a file server cluster. All subsequent hits to those results (for paging, sorting, etc...) are then deserialized from the file server, saving precious hits to the database and, really, making things nice and quick (especially when you get to the level of optimizing the hardware of the file servers by putting different types of search results on different controllers, etc...).
With this being said, we're attempting to cache as many controls as possible. But, with this, we realize that the majority of our controls contain session specific data, such as the session ID (a GUID), and other miscellaneous items related to state (both server, user and environment). So, we can't cache the output of every control with the session specific data, otherwise we'd quickly down the farm with as many concurrent sessions as we usually have open.
One of our caching strategies is to have control HTML in seperate .html files off the web root, and have the controls read in their respective HTML, if need be, and cache them. In the control HTML, we use what we call "template variables" in the form of:
[$SESSION_ID$]
etc...
These template variables get replaced at run-time at varying scopes (at the feature level, at the session level, and at the site level) of the application.
I'll post on this in more detail later this week. Some people may find this interesting.
Yesterday I was wrestling with attempting to get the CacheDependency to work correctly. For some reason when I set it, hit the page that uses it, and then attempt to edit the file that is the dependency, it's locked.
That can't be right. That defeats the whole purpose of the CacheDependency if the worker process is just going to lock it. So, I must be doing something wrong.
Frustrating, to say the least.
Thoughts?
UPDATE: It's fairly important to CLOSE your StreamReader as *it* locks the file. Gah. I feel stupid.