# Use Github together with HTML Component in Wix (Video)

**URL:** <https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [November 26, 2018, 3:05pm UTC](https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522 "2018-11-26T15:05:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas-kviby](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/andreas-kviby/32/790_2.png) [@andreas-kviby](https://forum.wixstudio.com/u/andreas-kviby)\
**Post date:** [November 26, 2018, 3:05pm UTC](https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522/1 "2018-11-26T15:05:54Z")

</div>

I just published a small tutorial how I use a Github repo to edit and work with HTML Component code in Visual Studio Code.

[![](https://us1.discourse-cdn.com/wix/original/3X/7/9/79abff5d5b5c1c0f02972733840e35ec2dc594c6.jpeg "How to use Github Pages connected to Wix") ](https://www.youtube.com/watch?v=enJr0QC7ZA8)

Happy coding!

#github #htmlcomponent

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [November 27, 2018, 7:18am UTC](https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522/2 "2018-11-27T07:18:18Z")

</div>

Freakin’ awesome Andreas! This could be very useful. Gotta find a way around the cache issue.

What? Should be drinking red wine??? I’ll have a beer instead.

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [November 27, 2018, 8:25am UTC](https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522/3 "2018-11-27T08:25:43Z")

</div>

Hey Andreas,

Not sure it will help in an iFrame (HtmlComponent), but since you already have this mechanism in place, maybe you can give this a quick try.

These meta tags are supposed to force clearing the cache:

```javascript
<meta http-equiv=“Pragma” content=”no-cache”>
<meta http-equiv=“Expires” content=”-1″>
<meta http-equiv=“CACHE-CONTROL” content=”NO-CACHE”>

```

Let us know if one of these works.

I’m going to set this up for myself when I get a chance.

---

<div class="post-metadata">

**Author:** ![andreas-kviby](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/andreas-kviby/32/790_2.png) [@andreas-kviby](https://forum.wixstudio.com/u/andreas-kviby)\
**Post date:** [November 27, 2018, 10:27am UTC](https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522/4 "2018-11-27T10:27:56Z")

</div>

I have tried all kinds of meta tags to prevent caching from happening but it seem like a problem that is not possible to solve using meta tags.

I was thinking of is the meta refresh trick would be usable and trying to add a random number to the url of self.location maybe? Will update you if it works.

---

<div class="post-metadata">

**Author:** ![andreas-kviby](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/andreas-kviby/32/790_2.png) [@andreas-kviby](https://forum.wixstudio.com/u/andreas-kviby)\
**Post date:** [November 27, 2018, 10:43am UTC](https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522/5 "2018-11-27T10:43:18Z")

</div>

Hey @yisrael-wix !  
So by adding some smart Javascript code I can now get around the caching of the content. I do not know if this is actually a good approach in production environments.

```javascript
<html>
 <head>
 <script type="text/javascript">
 window.onload = setupRefresh;
 
 var randomUrlToAppend = (Date.now() + Math.random()).toString();
 function setupRefresh() {
 setTimeout("refreshPage();", 500); // milliseconds
         }
 function refreshPage() {
 window.location = location.href + "?cacheKiller=" + randomUrlToAppend;
         }
 </script>
 </head>
 <body>
 <h1>wixshow.com </h1>
 <p>just updated this page, <code>v2.6</code> javascript refresh method</p>
 
 </body>
</html>

```

By using Javascript to actually refresh the page after n milliseconds and also adding a random string to the url the cache is overridden and the content is reloaded fresh and updated.

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [November 27, 2018, 1:01pm UTC](https://forum.wixstudio.com/t/use-github-together-with-html-component-in-wix-video/13522/6 "2018-11-27T13:01:47Z")

</div>

@andreas-kviby Don’t worry about production environments. Your Github technique wouldn’t be used in production in any case. The main idea is that the developer won’t have problems with cache during development - like you did during the video.

BTW - Take a Nobel prize out of petty cash.
