Default expiry time for HttpRuntime cache - httpruntime.cache

I know you can give specific expiry time by using System.Web.HttpRuntime.Cache.Add() but I'm curious what the default expiry time is when you add a cache item by doing System.Web.HttpRuntime.Cache["a"] = "b"
Thanks :)

Never mind I take my question back :) Apparently it's noAbsoluteExpiration

Related

Make HttpContext.Current.Cache refresh the cache every minute

I'm using HttpContext.Current.Cache. I want to store data in my cache for a minute and after that minute, delete the cache so I can put the data again whether it has changed or not. I want to do it every minute, no just in the next minute.
Don't know if I've been clear enough. If not, please tell me what is not clear and I'll try to explain it better.
Thanks in advance.
I think I found the solution. First, instead of using insert, we use add.
My Line should be this:
HttpContext.Current.Cache.Add("string", lstStr, null, Cache.NoAbsoluteExpiration, new TimeSpan(0,1,0), CacheItemPriority.Normal, null);
I think this solves the problem. If I missed something, please tell me.

Modify lifetime for url when change fe-password

I wonder how you can change the lifetime of the url when fe-user requests to change his password.
Does anyone know where to find these option?
I already looked it up at the internet and also tried to search for it in the typo3 global conf. No success.
Thanks in advance and for your hints.
As you can read in the manual, there is a configuration called forgetLinkHashValidTime where you can set the lifetime in hours.
For example, if you want a lifetime of 1 hour, just place in your Setup the Typoscript:
plugin.tx_felogin_pi1.forgetLinkHashValidTime = 1
Edit: There seems to be a typo in the manual, as far as I know it should be forgotLinkHashValidTime you should also try
plugin.tx_felogin_pi1.forgotLinkHashValidTime = 1

Any way to have UIDatePicker pick dates earlier than 1/1/1 AD/CE?

I'm pretty sure the answer must be no, since if I set its minimumDate to an earlier date, it still stops rolling back at 1 AD. Also if I set its start date to a BC/BCE date it goes to 1/1/1. I'm just hoping there is some secret trick someone might know.
Only by using a custom UIPickerView to do what you want I'm afraid...

JQuery UI / Datepicker : How to initialize datepicker with an empty year?

My problem is the following :
On my website, I use the Jquery-ui datepicker to allow my visitor to enter a date.
I have configured the datepicker such users can modify the month and the year.
However, I have noticed that they never enter the year : they leave in the default value.
In my mind, they don't see that they can edit the year value...
So, I would like to intialize the default year value to empty/blank and show an error alert if the user has not modified it.
I try to do that, but in vain....
So how can I do that ?
Maybe, there is an other way to force my users to select a correct year value. Have you got any suggestions ?
In advance, thanks for your answer.
I thought a little bit and I think what I would do is not possible...
How could the datpicker calculate the days of the month if the year is not specified?
So, Have you got any suggestions to force my users to change the year default value ?
You could identify what the default value is and then, in your onSelect callback you could see if the current year value is different than what the original was and execute whatever code seems appropriate.

WF DelayActivity fires immediately?

I have a Workflow I have created and deployed to a Sharepoint 2007 farm. When it runs against an item two delay activities I have created fire immediately.
I have setup a callback on the InitializeTimeoutDuration event. Through logs and debug output I can see that it is setting the delay to one hour. However, at the next SP timer job cycle (less than 5 minutes) the events proceeding the Delay activity fire off.
I'm lost here. Any help is greatly appreciated.
Update
Through some digging I was able to determine why this was firing off. Once the workflow started a record gets added to the ScheduledWorkItems table in the SP Content database. However, the "DeliveryDate" on the record is set to the current time while the "Created" date is set to one hour previous. However, the delay I'm using is 2 hours, so neither of these times make sense to me at all. Going to try hardcoding it....
Update 2
Even with a hardcoded duration the times are off. I hardcoded a 2 hour delay in and the "DeliveryDate" is now one hour in the future while the "Created" date is one hour in the past. So at least the difference between them is good.
Update
Well, that's embarrassing... found the problem. I'm posting it in here for others that may make mistakes like I do. First off, I was not correct in my UTC->local conversion. The times on the database were correct. What was not correct was how I was setting the TimeoutDuration:
// WRONG!
delayActivity.TimeoutDuration = new TimeSpan("1:00:00"); // one hour
what I should have been doing:
// RIGHT!
((DelayActivity)sender).TimeoutDuration = new TimeSpan("1:00:00"); // one hour
once I made that change everything else seems to be fine.
Well, that's embarassing... found the problem. I'm posting it in here for others that may make mistakes like I do. First off, I was not correct in my UTC->local conversion. The times on the database were correct. What was not correct was how I was setting the TimeoutDuration:
// WRONG!
delayActivity.TimeoutDuration = new TimeSpan("1:00:00"); // one hour
what I should have been doing:
// RIGHT!
((DelayActivity)sender).TimeoutDuration = new TimeSpan("1:00:00"); // one hour
once I made that change everything else seems to be fine.

Resources