Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7733719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:04:26+00:00 2026-06-01T07:04:26+00:00

I just need some advice on if this is wise. I’m loading my site

  • 0

I just need some advice on if this is wise. I’m loading my site data largely through AJAX requests. To save load time and server calls I’m saving all data loaded to global objects and just recycling that data if the user selects the page again.

I wondered if it is wise to cache an entire site onto ONE object, e.g.:

var page = ['level 1','level 2','level 3','level 4'];
var mysiteobj = [];
if (page[0] == 'level 1')
   if (!mysiteobj['level 1'])
      $.ajax(/*load data*/).done(function(data){ mysiteobj['level 1'] = data; /*display data*/ });
   else /*display mysiteobj['level 1']*/
   if (page[1] == 'level 2')
      if (!mysiteobj['level 1']['level 2'])
         $.ajax(/*load data*/).done(function(data){ mysiteobj['level 1']['level 2'] = data; /*display data*/ });
      else /*display mysiteobj['level 1']['level 2']*/
 ...etc

…and so forth. To clarify the rather odd notation, ‘level 1’ is all the geographic areas a user might look up, ‘level 2’ is all the departments in the geo the user might look it, ‘level 3’ would be the categories in the department in the geo, and say ‘level 4’ would be the product or entry listed in the category in the department in the geo.

Right now, my method is, I have an object with all the geographic areas, a second object is overwritten with a new department list every time a new geo loaded, and a third object holds my categories and fourth my listings/products.

If this makes sense, please advise. I guess the question simplified is, how large can you make an object before it becomes unwieldy and bogs down the browser?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:04:27+00:00Added an answer on June 1, 2026 at 7:04 am

    Why not just load the data as needed, if not loaded already.

    For example, you can load level 1.

    Then, when the user selects level 2, load that if not already there, and continue.

    So, you can keep what was already loaded, but just inform them that you are retrieving the data, if it takes time, otherwise people may understand that you are loading it.

    Personally, I would show the user that there is a load request, so they know what is going on.

    Preloading the entire site is a waste, IMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Help, I am a noob, just need some advice on this bit of code.
I'm just starting out with the whole ajax thing and I need some help.
I just need some advice. I already know how to play with bash, ruby,
I need some advice on how to model this simple categorization (?) example: I
Need some Advice on how to reference elements with jQuery (DOM/Traversing/Selectors). Sometimes its just
Need some advice again please. This is regarding a single developer shop. I have
Just after some advice regarding this database design situation. So I have two tables
I need some advice when it comes to solving a sorting algorithm. This particular
HI there, this is a little sticky situation and I need some advice. I
I need some advice regarding conversion of an AJAX TreeView control to a LinkButton

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.