REPOST : Cache not clearing AJAX

Problem : Not clearing the cache.

At onLoad Event…

Code to run an agent using AJAX :

var myAjax = new Ajax.Request(

‘http://’+server+‘/’+database+‘/PrintProjList?openagent’,

{method: ‘get’, parameters: a.toQueryString(), onComplete: update_values_projectlist}

);

Now problem is if I do some changes in a particular document then it would not refelct as it is taking the document which are stored in cache.

I have used

myAjax.setRequestHeader(‘If-Modified-Since’, ‘Fri, 31 Dec 1999 00:00:00 GMT’);

myAjax.setRequestHeader(‘Cache-Control’, ‘no-cache’);

but purpose does not resolve

Please let me know the solution.

Thanks

Subject: REPOST : Cache not clearing AJAX

Try to append Javascript Time as the dummy parameter to the url. This will make the browser think that it is a new url.

Example -

“?dummy=” + new Date().getTime();

This should solve the problem.

–Phani

Subject: RE-REPLY : Cache not clearing AJAX

Did you try my suggestion?

http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/9c528a34063759168525727c0047c071?OpenDocument

Andrew

Subject: RE: RE-REPLY : Cache not clearing AJAX

Yes i tried but did not help

Subject: RE: RE-REPLY : Cache not clearing AJAX

Thanks for helping…

Kiran the issue has been resolved.

Can u plz help me on another issue. Actually I m searching database thru ftsearch. It gives the searched document very well but the problem is when I open the particular document from the searched list then it won’t highlight the searched word. Can u please guide me in this regard? I have used &Highlight in the url but it is not highlighting…

Thanks for help

Subject: RE: RE-REPLY : Cache not clearing AJAX

So, How was it resolved??

I’m having the same trouble.

I’d sure like to know the solution.

And I’m sure that anyone else having this trouble would appreciate your sharing.

Thanks,

Con

Subject: RE: RE-REPLY : Cache not clearing AJAX

This works for me.

“vSearch?ReadViewEntries&dummy=” + new Date().getTime();

Subject: REPOST : Cache not clearing AJAX

Sorry, didn’t read through your whole question before my last post ;-p

When I have trouble with this sort of thing, I try to run the agent in the client to see exactly what the agent is doing. I would amend the agent by not using the querystring to get the search parameters- just use a variable for the search and set it yourself. This will allow you to debug the agent.

Also, it seems that in your agent you are printing out a new style definition and table every time you loop through the documents-

While Not (doc Is Nothing)

lists( counter )=doc.ColumnValues( 10 )

sHTML=“td.sample{ padding : 2px; font : normal 9pt Verdana, Arial, sans-serif; border-color : #CECFCE #CECFCE #CECFCE #CECFCE; border-style : solid; border-top-width : 2px; border-right-width : 2px; border-bottom-width : 2px; border-left-width : 2px; background-color : rgb(239,239,239); }

” & lists( counter ) & "
"

Print sHTML

Set doc = view.GetNextDocument( doc )

counter = counter + 1

Wend

Sorry if I am misunderstanding the code, but you might be better to generate an html string for each line of a table instead-

While Not (doc Is Nothing)

sHTML= sHTML & lists( counter )

Wend

print “

” & sHTML & “
”

Hope this helps

Andrew