I was doing tests, and, in one of them, I have checked the box disable cache
in the network tools tab of the browser. Since then, express.static
it has stopped serving me 1 . Always the same.
Of course, the file is still in the same place:
static/
webix.js
index.html
navigo.min.js
drivers/
webixui.js
misc.js
navigorouter.js
My server code is:
// Las rutas que uso:
app.post( '/config.json', function( req, res ) {
res.json( require( './app/config/main.js' ) );
res.end( );
} );
app.use( function( req, res, next ) {
console.log( req.url );
next( );
}, express.static( path.join( __dirname, 'static' ) ) );
Simple as the mechanism of a pacifier. The part of console.log( )
the I have put to check the requests that I am receiving:
/webix.js
/navigo.min.js
/drivers/webixui.js
/drivers/misc.js
/drivers/navigorouter.js
/skins/mini.min.css
It is noted that if I receive the request. However, the browser does not get a response to it.
The upload mechanism is custom : I get through POST
a JSON
, and one of its fields contains the files .js
to upload. The code for this is:
if( 'js' in config ){
config.js.forEach( function( item ) {
++loadsCount;
const ref = document.createElement( 'script' );
ref.onload = resourceLoaded;
document.head.appendChild( ref );
ref.src = item;
console.log( `Begin src ${item}` );
} );
}
Through the console.log( )
I see that indeed the request is being made:
Begin src webix.js (index):94
Begin src navigo.min.js (index):94
Begin src drivers/webixui.js (index):94
Begin src drivers/misc.js (index):94
Begin src drivers/ navigorouter.js (index):94
Begin href skins/mini.min.css (index):112
And in the tab Herramientas de Red
I can confirm it: the browser requests everything it has to request:
Examining the headers sent by the browser, I don't see anything unusual :
With all that, in principle I rule out any problem in the browser part. I have verified (at the beginning of the question) that the node.js
is correctly receiving the requests. And my server does not respond with a 404
or any type of error; it just doesn't send a response for that particular file.
I have cleared the browser cache, but there is no way. That file has not been served again. And when using another browser, something similar happens: the file has been served only 1 time , the first time. And from there, the observed behavior is repeated: the file is not served.
How can I fix this ghost file ?