Skip to content

Commit

Permalink
devlogs init
Browse files Browse the repository at this point in the history
  • Loading branch information
es5es5 committed May 14, 2021
1 parent bc64831 commit f6c6927
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Binary file added devlogs/WYSIWYG/images/base64.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added devlogs/WYSIWYG/images/img_tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions devlogs/WYSIWYG/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Wrapping the Open source WYSIWYG.

>  
> <img src="./images/base64.png">
>
> *"에디터에 사진을 추가했더니 게시글 데이터가 미친듯이 올라갔어요 !"*
#### 1. Situation
[summernote](https://summernote.org/) 를 비롯한 대부분의 오픈소스 위지위그 에디터에 이미지를 첨부하면 **base64 인코딩** 되면서 첨부된다.

#### 2. Problem
저렇게 엄청난 문자열 데이터를 **데이터베이스에 저장하는 것 자체도 문제**인데, http 통신을 할 때 패킷이 감당할 수 없는 데이터를 보내기 때문에 **통신 자체가 안되는 경우**까지도 생긴다.

#### 3. Solution
해결법은 **AWS S3, MINIO 같은 스토리지 서버에 이미지를 저장**하고, 그 이미지를 API GET 하는 방법이다.

#### 4. Process
간단한 프로세스는 이렇다.

1. 이미지 첨부
2. 스토리지 서버에 저장
3. **이미지 태그로 치환 (중요 포인트)**

##### 4-1. support
"이미지 태그로 치환" 이 부분은 에디터단에서 지원해주는게 중요하다.
만약 위 프로세스대로 진행하려는데, 에디터에서 해당 기능을 지원해주지 않는다면.. <s>매우 고생할 것이다.</s> 🤦

그렇기 때문에 시중에 있는 오픈소스 위지위그 에디터를 채택할 때 **해당 기능을 지원 해주는지 반드시 고려**해봐야한다.

##### 4-2. then..

> &nbsp;
> <img src="./images/img_tag.png">
>
> *"이미지 태그 " &lt;img&gt; " 하나로 불러오니깐 깔끔하네 !"*

0 comments on commit f6c6927

Please sign in to comment.