Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Error Cache Miss -400 - Frame LoadUrl

marcoscdoni
Posts: 25
Joined: Thu Sep 21, 2017 4:33 pm

Error Cache Miss -400 - Frame LoadUrl

Post by marcoscdoni »

Hello Salvador!

After updating from 3.3163.1671 to version 3.3239.1723 I'm facing problem when I call following code I get error code "ERR_CACHE_MISS", code "-400";

ChromiumBrowser.Browser.StopLoad;
ChromiumBrowser.Browser.GetFrame('framename').LoadUrl('https://www.someurl.com');

Do you have any idea what causes the error?

Thank you!
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Error Cache Miss -400 - Frame LoadUrl

Post by salvadordf »

ERR_CACHE_MISS is a Chromium error code that is usually caused by navigating to a page with POST data via back or forward buttons.
Sometimes it can be solved clearing the cache.

Here you have more information :
https://usefulpcguide.com/17838/err_cache_miss/
marcoscdoni
Posts: 25
Joined: Thu Sep 21, 2017 4:33 pm

Re: Error Cache Miss -400 - Frame LoadUrl

Post by marcoscdoni »

But I do not understand why in the previous version it worked. No line of code was changed.

What would be the method to clear the cache?

Would doing this exclude cookies as well? I need to keep a session with cookies.
marcoscdoni
Posts: 25
Joined: Thu Sep 21, 2017 4:33 pm

Re: Error Cache Miss -400 - Frame LoadUrl

Post by marcoscdoni »

I noticed that this only occurs when I pass a parameter via query string.

Something like:

https://www.google.com/?lang=en-us
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Error Cache Miss -400 - Frame LoadUrl

Post by salvadordf »

Maybe that web page has a form that can't be cached.

The cause of that error is usually what I commented in my previous post but it could be caused by internal changes or new issues in Chromium.
If you search in Google you will find some Chromium issues about this a few years ago.

I don't work for Google and I'm not an expert in Chormium but you can copy the cache directory in another drive and make some tests.

To clear the cache you have to close your application and delete the contents of the directory you used in GlobalCEFApp.cache.
If you left the GlobalCEFApp.cookies property blank then the cookies are stored in the cache directory too.
marcoscdoni
Posts: 25
Joined: Thu Sep 21, 2017 4:33 pm

Re: Error Cache Miss -400 - Frame LoadUrl

Post by marcoscdoni »

Would you have an example of how to load a request in the browser instead of a url?

I would like to test if a request would not cause the error to occur.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Error Cache Miss -400 - Frame LoadUrl

Post by salvadordf »

This is an example for DCEF3 but it should work in CEF4Delphi :

https://stackoverflow.com/questions/129 ... h-chromium
marcoscdoni
Posts: 25
Joined: Thu Sep 21, 2017 4:33 pm

Re: Error Cache Miss -400 - Frame LoadUrl

Post by marcoscdoni »

Hello Salvador! Me again!

I still couldn't to solve that issue. For that reason, I'd like you help me, if you could.

When I call the method directly in TCromium I get following results

//-- Here occurs error 400
ObjChromium.Browser.GetFrame('body').LoadUrl(someUrl);

//-- Here DO NOT occurs (I can't use MainFrame because I need load new pages on "body" frame)
ObjChromium.Browser.MainFrame.LoadUrl(someUrl);


//-- Here DO NOT occurs error (using javascript)
ObjChromium.MainFrame.ExecuteJavaScript('window.document.body.body.location="'+fullUrl+'"', '', 0);



Due to the circumstance that the error occurs I'm believing that it could be some bug, since this did not happen in older versions. The latest version that you provided also occurs.

Could that be this related to some unknowed CEF bug?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Error Cache Miss -400 - Frame LoadUrl

Post by salvadordf »

Have you tried loading that URL in a HTML frame without CEF?
Some websites block that kind of requests.

Create a simple web page in your server with some frames and load that URL in one of them. Then try to visit your website with Chrome to see the results.
marcoscdoni
Posts: 25
Joined: Thu Sep 21, 2017 4:33 pm

Re: Error Cache Miss -400 - Frame LoadUrl

Post by marcoscdoni »

Hello Salvador!

I've created(changed your simplebrowser demo) a small sample reproducing the issue.

If you could test it would be nice
https://goo.gl/bymDXs


The error behavior is weird:

1) If you open the application and click the first time in the option to load through the GetFrame method, error occurs.

2) If you open the application and at least once load the frame "body" through javascript, in the following requests using GetFrame the error does not occur anymore.

Thank you!
Post Reply