Skip to content

Commit 068a55d

Browse files
done
1 parent 7ab5dc1 commit 068a55d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ <h3>Explorer</h3>
107107
<script
108108
src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-markup-templating.min.js"></script>
109109
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-php.min.js"></script>
110-
<script src="script.js"></script>
110+
<script src="script.js?v=1.0"></script>
111111
</body>
112112

113113
</html>

script.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const outputConsole = document.getElementById('output-console');
1111
const clearConsoleBtn = document.getElementById('clear-console');
1212
const refreshFilesBtn = document.getElementById('refresh-files');
1313

14-
const CACHE_KEY = 'php_repos_cache';
14+
const CACHE_KEY = 'php_repos_cache_v1';
1515
const CACHE_DURATION = 5 * 60 * 1000; // 5 minutes
1616

1717
let currentCode = '';
@@ -37,7 +37,7 @@ async function fetchFiles(isBackground = false) {
3737
if (!isBackground) {
3838
// checks if we already have files displayed (optimization)
3939
if (fileListEl.children.length === 0 || fileListEl.querySelector('.loading-spinner')) {
40-
fileListEl.innerHTML = '<div class="loading-spinner"><div class="spinner"></div></div>';
40+
fileListEl.innerHTML = '<div class="loading-spinner"><div class="spinner"></div></div>';
4141
}
4242
}
4343

@@ -59,12 +59,12 @@ async function fetchFiles(isBackground = false) {
5959

6060
// 2. Data not in cache or expired, fetch from API
6161
if (!usedCache) {
62-
// Remove timestamp to allow browser-level caching (304 Not Modified)
62+
// Remove timestamp to allow browser-level caching (304 Not Modified)
6363
const response = await fetch(API_URL);
6464

6565
if (!response.ok) throw new Error(`GitHub API Error: ${response.status}`);
6666
data = await response.json();
67-
67+
6868
// Save to cache
6969
localStorage.setItem(CACHE_KEY, JSON.stringify({
7070
timestamp: Date.now(),

0 commit comments

Comments
 (0)