What is the best way to cache a menu system locally in a browser?

I have a very large cascading menu system with over 300 items. (I know this is big, but it's a requirement.)
It is currently written in javascript, so the external file is cached by browsers.

To improve search engine results, I need to convert this to css menu system.
I understand that browsers will also cache external stylesheets, but

  • Is there a way to cache menu contents ( <ul>and tags <li>)?

If I use javascript ( document.write) to write content, I could have this in an external javascript file that will be cached locally, but

  • will it be a search engine friendly?

What is the best solution?

+3
source share
3 answers

The best way to accomplish what you want to do is SiteMaps to tell Google about the addresses of your website. Basically, you will want to translate your hierarchical data for the menu into SiteMap.

+6
source

You could pre-create the menu in static html / javascript files and pull out all the pages from the same URL on your site. Thus, the client browser will do the caching. You just need to take a step in the deployment that generates html files for the menu.

Try to make it generate as much regular HTML as possible (+ JS + CSS), then everything that needs to be dynamic can be customized using javascript.

0
source

CSS HTML, Java script. . < http://www.netwiz.com.au/cssmenu.htmlvalue > . , , CSS HTML , ul li CSS/HTML .

300 , . , , iframe, ( ). , , , , .

0
source

Source: https://habr.com/ru/post/1696794/


All Articles