Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the classic interview questions at the front end of web?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the classic interview questions in front of web". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what are the classic interview questions in front of web.

1. How to upload the code to the server and transcode testing using Webpack?

(1) Code upload:

You can use sftp-Webpack-plugin, but you can extract the subfolders, which is not elegant. You can use gulp+Webpack to do this.

(2) Transcoding test

Webpack uses babel to transcode ES6, and open devtool: "source-map" to test the browser. Apply karma or mocha for unit testing.

2. What if the Webpack package file is too large?

Webpack packages all our files into a JS file, so that even if you are a small project, the packaged file will be very large. It can be optimized from the aspects of removing unnecessary plug-ins, extracting third-party libraries, code compression, code segmentation, and setting cache.

3, CSS,JS code compression, and code CDN hosting, picture integration.

(1) CSS,JS code compression:

It can be done by using gulp's gulp-uglify,gulp-minify-css module; it can be done by using webpack's UglifyJsPlugin compression plug-in.

(2) CDN:

Content delivery Network (CDN) is a strategically deployed overall system, which includes four elements: distributed storage, load balancing, redirection of network requests and content management. The main features are: local Cache acceleration, mirroring service, remote acceleration, bandwidth optimization. The key technologies are: content publishing, content routing, content exchange, performance management. CDN website acceleration is suitable for consulting-based sites. CDN is for domain name acceleration, not for website servers. Compared with the mirror station, CDN does not require the visitor to manually select the mirror station to visit. After using CDN, the website can use CDN to achieve acceleration effect without any modification. If the page you see through CDN is still an old page, you can solve it through URL push service. New pages and images do not need to be pushed by URL. Dynamic web pages can be used without caching pages and pictures that require high immediacy. CDN can be managed through git or SVN.

(3) Image integration

One of the most effective ways to reduce the loading time of a site is to reduce the number of HTTP requests for a site. An effective way to achieve this goal is to integrate multiple images into one image through CSS Sprites--, and then use CSS to locate. The disadvantage is poor maintainability. You can use Baidu's fis/webpack to manage sprite automatically.

4. Do not want others to steal your pictures, what should I do to access your server resources?

At present, there are two main methods of hotlink protection:

(1) set Referer: suitable for users who do not want to write code, and also for users who like to develop

(2) signature URL: suitable for users who like to develop

5. How to solve the memory leaks encountered in the development process?

There are several conditions for memory leaks:

(1) when the element in the page is removed or replaced, if the event bound to the element has not been removed, it will not be properly handled in IE. In this case, you have to manually remove the event, otherwise there will be a memory leak.

(2) because the function is defined within the function, and the reference of the internal function-event callback is exposed, a closure is formed. Closures can maintain local variables within a function so that they cannot be released.

Thank you for your reading, these are the contents of "what are the classic interview questions on the front end of web?" after the study of this article, I believe you have a deeper understanding of what the classic interview questions on the front end of web have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report