Last post Oct 05, 2014 09:18 AM by Rivelyn
Oct 02, 2014 08:13 PM|Rivelyn|LINK
I have this line of code on a domain.
Cache.Insert("storeTweets", Source, Nothing, DateTime.Now.AddMinutes(15), Cache.NoSlidingExpiration)
It handles caching of our store tweets and works perfect.
However the exact same line of code on a subdomain of the same domain does not seem to be updating after 15 minutes, it does not seem to be updating at all.
Any guesses as to why a domain would handle cache differently to a subdomain?
Oct 03, 2014 06:03 AM|PatriceSc|LINK
I would do a test page that would cache just the current date/time so that I can make 100% sure when the cache was populated for the last time.
Oct 03, 2014 07:56 AM|Rivelyn|LINK
Yea I'm going to have to go back and start with that. I did that when I worked on the original code to test that my code for the cache was correct.
Funny thing is, this was working fine up until maybe a week ago and I've changed no code.
Oct 03, 2014 10:18 AM|PatriceSc|LINK
Or could it be that you cache actually the same data again and again so the cache appears to not work because of that ? (for example if the data source comes itself from an http cached ressource ?) Good luck.
Oct 03, 2014 11:22 AM|Rivelyn|LINK
But.... The same code works perfectly on the parent domain, updates every 15 minutes.. The code has stopped working on the sub domain only. If I where caching the same data over and over it would not work on the parent domain either...
Oct 03, 2014 12:19 PM|PatriceSc|LINK
It was just a guess. If you think it doesn't work because data are never updated then either you really have a cache problem or source data are really never updated. I would test to make sure if the cache works or not.
Technically speaking I don't see how being a subdomain could change anything. What is the rather the difference from an application point of view? This is two different web applications. They have a different purpose but both use the exact same data source
for this cached elements or are they distinct sources... etc...
Anyway once you know if this is really an issue about the cache or about what is placed in the cache, it should be easier to see in which direction to search.
Oct 05, 2014 09:18 AM|Rivelyn|LINK
Thanks a lot for you suggestions Patrice, I marked your last comment as my answer. The actual problem.... Completely my fault....
I created a custom 404 page a while back since this was a re-launch of an older site with a lot of new changes. I knew right from the start there would be a lot of 404 errors from old cached SE results and bookmarks. The 404 page had old code that was from
a test build of my twitter feed scripts and it was responsible for caching the results without updating every 15 minutes, and since that page was seeing a boat load of hits it was propagating the cache issue throughout the rest of the site.
Anyway, a few grey hairs later it's all fixed now....