close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can I remove the cache?

Thread began 2/16/2010 4:37 pm by eric378598 | Last modified 2/18/2010 10:02 am by Eric Mittman | 1584 views | 4 replies |

eric378598

Can I remove the cache?

I only use LAT and LON for all my members.

I have modified the code as best I could so far to get the result i wanted.

I do not need the cache page stuff (I believe) if every point has the lat / lon stored in the database.

What code can i remove if i never look up a zip, city....

Link: <a href="http://www.gtha.com/dsp_MemLnks.cfm">GTHA Members</a>

Code can be sent if needed.


My page shows 177 points and loads in 45 seconds to 3 minutes depending on environment.

This is too slow for me. I am used to very quick respones from my database.

From the posts, it seems this page cache stuff is causing the issue. I don't need to lookup addresses.



Any help the great minds of this forum can provide is greatly appreciated.



Kindest Regards

Eric

Sign in to reply to this post

eric378598

Took out the code

I went ahead and took out the code that gets the LAT LONG by address in the wagmp.cfm file I use.

Did not see any difference in load speed.

I will now look into loading the map first then the points.

My wagmp.cfm file is now this....
<cfquery name="qry_members" datasource="#application.dsn#" username="#application.dsnuser#" password="#application.password#">
SELECT [mem_id]
,[member_name]
,[street_address]
,[city]
,[postal_code]
,[phone_number]
,[website]
,[tblmemLatLon].[Lat]
,[tblmemLatLon].[Lon]
FROM [memberstbl] LEFT JOIN [tblmemLatLon]
ON [memberstbl].[mem_id] = [tblmemLatLon].[PK_ID]
WHERE memberstbl.delete_status <> 1
AND memberstbl.mem_id <> 171
ORDER BY memberstbl.member_name
</cfquery>
function WAMapRef(mapObj) {
this.obj = mapObj;
this.directions = false;
this.icons = [];
this.markers = [];
this.addresses = [];
this.points = [];
return this;
}

function WAMapPoint(theMarker, theAddress, theIcon) {
this.icon = theIcon;
this.marker = theMarker;
this.address = theAddress;
return this;
}

function wagmp_map_5() {
if(GBrowserIsCompatible()) {
if(!document.getElementById('wagmp_map_5')) return false;
var map = new GMap2(document.getElementById('wagmp_map_5'));
wagmp_map_5_obj = new WAMapRef(map);
map.enableContinuousZoom();
map.enableDoubleClickZoom();
map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl());
map.addControl(new GMapTypeControl());
var geocoder = new GClientGeocoder();

var fromAddress = {
enabled: false,
street: '<cfoutput></cfoutput>',
city: '<cfoutput></cfoutput>',
state: '<cfoutput></cfoutput>',
zip: '<cfoutput></cfoutput>',
country: '<cfoutput></cfoutput>',
full: ''
};

var icon_0 = new GIcon();
icon_0.image = 'plugins/google_javascript/images/traditionalpillow_pacifica.png';
icon_0.shadow = 'google_javascript/images/traditionalpillow_shadow.png';
icon_0.iconSize = new GSize(34,35);
icon_0.shadowSize = new GSize(34,35);
icon_0.iconAnchor = new GPoint(9,33);
icon_0.infoWindowAnchor = new GPoint(19,0);
icon_0.printImage = 'plugins/google_javascript/images/traditionalpillow_pacifica.gif';
icon_0.mozPrintImage = 'plugins/google_javascript/images/traditionalpillow_pacifica_mozprint.png';
icon_0.printShadow = 'google_javascript/images/traditionalpillow_shadow.gif';
icon_0.transparent = 'google_javascript/images/traditionalpillow_pacifica_transparent.png';

var icon_1 = new GIcon;
icon_1.image = 'plugins/google_javascript/images/traditionalpillow_pacifica_gtha.png';
icon_1.shadow = 'google_javascript/images/traditionalpillow_shadow.png';
icon_1.iconSize = new GSize(34,35);
icon_1.shadowSize = new GSize(34,35);
icon_1.iconAnchor = new GPoint(9,33);
icon_1.infoWindowAnchor = new GPoint(19,0);
icon_1.printImage = 'plugins/google_javascript/images/traditionalpillow_pacifica_gtha.gif';
icon_1.mozPrintImage = 'plugins/google_javascript/images/traditionalpillow_pacifica_mozprint.png';
icon_1.printShadow = 'google_javascript/images/traditionalpillow_shadow.gif';
icon_1.transparent = 'google_javascript/images/traditionalpillow_pacifica_transparent.png';

<cfset qry_members_id=0>
<cfoutput query="qry_members">
var address_0_#qry_members_id# = {
street: '[Address]',
city: '',
state: '',
zip: '',
country: '',
infowindow: '<cfoutput><a href="http://#qry_members.website#">#qry_members.member_name#</a></cfoutput>',
infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;">#Replace("<strong>" & ToString(qry_members.member_name) & "</strong><br />" & ToString(qry_members.street_address) & "<br />" & ToString(qry_members.city) & "<br />" & ToString(qry_members.postal_code) & "<br />" & ToString(qry_members.phone_number) & "", "'", "\'")#</span>',
full: '<cfoutput>#Replace("" & ToString(qry_members.Lat) & "", "'", "\'")#</cfoutput>,#Replace("" & ToString(qry_members.Lon) & "", "'", "\'")#',
isdefault: true,
addressType: 'coordinates',
loop: 'qry_members',
latitude: '#Replace("" & ToString(qry_members.Lat) & "", "'", "\'")#',
longitude: '#Replace("" & ToString(qry_members.Lon) & "", "'", "\'")#',
markerStyle: 'Google Traditional (pillow)',
markerColor: 'Pacifica'
};

if (address_0_#qry_members_id#.addressType == "coordinates") {
var cacheReturn = '';
}
if (cacheReturn != "" || (address_0_#qry_members_id#.addressType == "coordinates")) {
if(address_0_#qry_members_id#.addressType == "coordinates") {
var latitude = address_0_#qry_members_id#.latitude;
var longitude = address_0_#qry_members_id#.longitude;
}
var point = new GLatLng(latitude, longitude);
if (point && !isNaN(latitude)) {
wagmp_map_5_obj.addressFailed = false;
var marker_0_#qry_members_id# = new GMarker(point, icon_0);
GEvent.addListener(marker_0_#qry_members_id#, 'click', function() {
marker_0_#qry_members_id#.openInfoWindowHtml(address_0_#qry_members_id#.infowindowtext);
});
if(!fromAddress.enabled || 'address_0_#qry_members_id#' != 'address_0_0') {
if('address_0_#qry_members_id#' == 'address_0_0')
map.setCenter(new GLatLng(43.6573215, -79.3734778), 10);
map.addOverlay(marker_0_#qry_members_id#);
}
wagmp_map_5_obj.addressFailed = true;
}
}
<cfset qry_members_id=qry_members_id+1>
</cfoutput>
var gthalatlon = new GLatLng(43.639057,-79.380834);
var marker_gtha = new GMarker(gthalatlon, icon_1);
GEvent.addListener(marker_gtha, 'click', function() {
marker_gtha.openInfoWindowHtml('<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><br /><strong>Greater Toronto Hotel Association</strong><br />Phone: 416-351-1276<br />Fax: 416-351-7749</span>');

});
map.addOverlay(marker_gtha);


}
}

This is the smallest I have done yet!

I see other maps around that load faster, what is different with this method?

For those of you that use ColdFusion, yes, for some reason I needed to put my query at the top of this page even though the code generated did not.

Regards, eric

Sign in to reply to this post

eric378598

a little faster

I REM'd out the geocoder control

It does seem a little faster.

The time to load locally on my PC is 10 seconds compared to 20 to 40 seconds live.

dsp_MemLnks.cfm is the live page.

Sign in to reply to this post

eric378598

More code removed

<cfquery name="qry_members" datasource="#application.dsn#" username="#application.dsnuser#" password="#application.password#">
SELECT [member_name]
,[street_address]
,[city]
,[postal_code]
,[phone_number]
,[tblmemLatLon].[Lat]
,[tblmemLatLon].[Lon]
FROM [memberstbl] LEFT JOIN [tblmemLatLon]
ON [memberstbl].[mem_id] = [tblmemLatLon].[PK_ID]
WHERE memberstbl.delete_status <> 1
AND memberstbl.mem_id <> 171
ORDER BY memberstbl.member_name
</cfquery>
function WAMapRef(mapObj) {
this.obj = mapObj;
this.directions = false;
this.icons = [];
this.markers = [];
this.addresses = [];
this.points = [];
return this;
}

function WAMapPoint(theMarker, theAddress, theIcon) {
this.icon = theIcon;
this.marker = theMarker;
this.address = theAddress;
return this;
}

function wagmp_map_5() {
if(GBrowserIsCompatible()) {
if(!document.getElementById('wagmp_map_5')) return false;
var map = new GMap2(document.getElementById('wagmp_map_5'));
wagmp_map_5_obj = new WAMapRef(map);
map.enableContinuousZoom();
map.enableDoubleClickZoom();
map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl());
map.addControl(new GMapTypeControl());

var fromAddress = {
enabled: false,
street: '<cfoutput></cfoutput>',
city: '<cfoutput></cfoutput>',
state: '<cfoutput></cfoutput>',
zip: '<cfoutput></cfoutput>',
country: '<cfoutput></cfoutput>',
full: ''
};

var icon_0 = new GIcon();
icon_0.image = 'plugins/google_javascript/images/traditionalpillow_pacifica.png';
icon_0.shadow = 'google_javascript/images/traditionalpillow_shadow.png';
icon_0.iconSize = new GSize(34,35);
icon_0.shadowSize = new GSize(34,35);
icon_0.iconAnchor = new GPoint(9,33);
icon_0.infoWindowAnchor = new GPoint(19,0);
icon_0.printImage = 'plugins/google_javascript/images/traditionalpillow_pacifica.gif';
icon_0.mozPrintImage = 'plugins/google_javascript/images/traditionalpillow_pacifica_mozprint.png';
icon_0.printShadow = 'google_javascript/images/traditionalpillow_shadow.gif';
icon_0.transparent = 'google_javascript/images/traditionalpillow_pacifica_transparent.png';

var icon_1 = new GIcon;
icon_1.image = 'plugins/google_javascript/images/traditionalpillow_pacifica_gtha.png';
icon_1.shadow = 'google_javascript/images/traditionalpillow_shadow.png';
icon_1.iconSize = new GSize(34,35);
icon_1.shadowSize = new GSize(34,35);
icon_1.iconAnchor = new GPoint(9,33);
icon_1.infoWindowAnchor = new GPoint(19,0);
icon_1.printImage = 'plugins/google_javascript/images/traditionalpillow_pacifica_gtha.gif';
icon_1.mozPrintImage = 'plugins/google_javascript/images/traditionalpillow_pacifica_mozprint.png';
icon_1.printShadow = 'google_javascript/images/traditionalpillow_shadow.gif';
icon_1.transparent = 'google_javascript/images/traditionalpillow_pacifica_transparent.png';

<cfset qry_members_id=0>
<cfoutput query="qry_members">
var address_0_#qry_members_id# = {
street: '',
city: '',
state: '',
zip: '',
country: '',
infowindow: '',
infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;">#Replace("<strong>" & ToString(qry_members.member_name) & "</strong><br />" & ToString(qry_members.street_address) & "<br />" & ToString(qry_members.city) & "<br />" & ToString(qry_members.postal_code) & "<br />" & ToString(qry_members.phone_number) & "", "'", "\'")#</span>',
full: '<cfoutput>#Replace("" & ToString(qry_members.Lat) & "", "'", "\'")#</cfoutput>,#Replace("" & ToString(qry_members.Lon) & "", "'", "\'")#',
isdefault: true,
addressType: 'coordinates',
loop: 'qry_members',
latitude: '#Replace("" & ToString(qry_members.Lat) & "", "'", "\'")#',
longitude: '#Replace("" & ToString(qry_members.Lon) & "", "'", "\'")#',
markerStyle: 'Google Traditional (pillow)',
markerColor: 'Pacifica'
};

if (address_0_#qry_members_id#.addressType == "coordinates") {
var cacheReturn = '';
}
if (cacheReturn != "" || (address_0_#qry_members_id#.addressType == "coordinates")) {
if(address_0_#qry_members_id#.addressType == "coordinates") {
var latitude = address_0_#qry_members_id#.latitude;
var longitude = address_0_#qry_members_id#.longitude;
}
var point = new GLatLng(latitude, longitude);
if (point && !isNaN(latitude)) {
wagmp_map_5_obj.addressFailed = false;
var marker_0_#qry_members_id# = new GMarker(point, icon_0);
GEvent.addListener(marker_0_#qry_members_id#, 'click', function() {
marker_0_#qry_members_id#.openInfoWindowHtml(address_0_#qry_members_id#.infowindowtext);
});
if(!fromAddress.enabled || 'address_0_#qry_members_id#' != 'address_0_0') {
if('address_0_#qry_members_id#' == 'address_0_0')
map.setCenter(new GLatLng(43.6573215, -79.3734778), 10);
map.addOverlay(marker_0_#qry_members_id#);
}
wagmp_map_5_obj.addressFailed = true;
}
}
<cfset qry_members_id=qry_members_id+1>
</cfoutput>
var gthalatlon = new GLatLng(43.639057,-79.380834);
var marker_gtha = new GMarker(gthalatlon, icon_1);
GEvent.addListener(marker_gtha, 'click', function() {
marker_gtha.openInfoWindowHtml('<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><br /><strong>Greater Toronto Hotel Association</strong><br />Phone: 416-351-1276<br />Fax: 416-351-7749</span>');

});
map.addOverlay(marker_gtha);


}
}

That is my latest prune job. Took out more stuff I don't need. All in the name of speed!

Sign in to reply to this post

Eric Mittman

I'm curious what specific changes you made that you found were most helpful for increasing the speed. This may be something that we can look into incorporating or changing up in the product.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...