mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-25 05:43:46 +01:00
Fast load time
This commit is contained in:
parent
768420b677
commit
62b92912b6
@ -6,11 +6,11 @@ class GeometriesLoader{
|
|||||||
const myset=item.set.split("#").join("")
|
const myset=item.set.split("#").join("")
|
||||||
try {
|
try {
|
||||||
const mol=await Geometry.loadXYZAsync(`/${myset}/${mymol}.xyz`)
|
const mol=await Geometry.loadXYZAsync(`/${myset}/${mymol}.xyz`)
|
||||||
xyzs.push(mol)
|
xyzs.push(mol)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Geometry not found",item)
|
console.error("Geometry not found",item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return xyzs.flat()
|
return xyzs.flat()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,8 @@ class Geometry {
|
|||||||
static async loadXYZAsync(file) {
|
static async loadXYZAsync(file) {
|
||||||
switch (trueTypeOf(file)) {
|
switch (trueTypeOf(file)) {
|
||||||
case String.name:
|
case String.name:
|
||||||
file = getFullDataPath("/structures/"+file)
|
file = getFullDataPath("structures"+file)
|
||||||
const maxAge= (DebugMode.Enabled,0,600)
|
var str = getTextFromFileUrl(file)
|
||||||
var str = await getTextFromFileUrlAsync(file,{"Cache-Control":`max-age=${maxAge}`})
|
|
||||||
break;
|
break;
|
||||||
case File.name:
|
case File.name:
|
||||||
var str = await getTextFromUploadedFileAsync(file)
|
var str = await getTextFromUploadedFileAsync(file)
|
||||||
@ -33,4 +32,4 @@ class Geometry {
|
|||||||
}
|
}
|
||||||
return geoms
|
return geoms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ class dataFileBase {
|
|||||||
file = getFullDataPath(file)
|
file = getFullDataPath(file)
|
||||||
// const maxAge= (DebugMode.Enabled,0,600)
|
// const maxAge= (DebugMode.Enabled,0,600)
|
||||||
// var str = await getTextFromFileUrlAsync(file,{"Cache-Control":`max-age=${maxAge}`})
|
// var str = await getTextFromFileUrlAsync(file,{"Cache-Control":`max-age=${maxAge}`})
|
||||||
var str = await getTextFromFileUrl(file)
|
var str = getTextFromFileUrl(file)
|
||||||
break;
|
break;
|
||||||
case File.name:
|
case File.name:
|
||||||
var str = await getTextFromUploadedFileAsync(file)
|
var str = await getTextFromUploadedFileAsync(file)
|
||||||
|
Loading…
Reference in New Issue
Block a user