Safari has a cache of the old version of index.template.php

Started by confuseamuse, September 03, 2017, 12:31:06 PM

Previous topic - Next topic

confuseamuse

I've tried emptying the cache several times. Whilst it has emptied it for all websites, it doesn't do it for SMF.

I changed the index.template.php file to include some echo metadata, and none of it is showing up when I 'Inspect Element' the webpage. Sometimes it does appear after clearing the cache, but a refresh reverts it back.

Funnily enough, it changes the CSS files in real time, just not the index.template changes. The other browser that does this (which I've tested) is Chrome, whereas Firefox doesn't seem to have this problem.

Mods, I'm not sure what board is the best for this question as I don't think it's an SMF issue.

Arantor


confuseamuse

Quote from: Arantor on September 03, 2017, 12:37:09 PM
Where did you add the echo statement?

Added it here in index.template.php:

Code (Find) Select

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0" />';


Code (Add After) Select

// Favicon and other web related logos
       
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/avatar.css" />
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#aad922">
    <link rel="mask-icon" href="CAJICAN.svg" color="#aad922">
    <meta name="application-name" content="CAJICAN"/>
    <meta name="msapplication-tooltip" content="Start Creative Arts, Journalism and Individual Collective Activism Network app" />
    <meta name="msapplication-starturl" content="/" />
    <meta name="msapplication-square70x70logo" content="small.png"/>
    <meta name="msapplication-square150x150logo" content="medium.png"/>
    <meta name="msapplication-wide310x150logo" content="wide.png"/>
    <meta name="msapplication-square310x310logo" content="large.png"/>
    <meta name="msapplication-TileColor" content="#aad922"/>
    <meta name="msapplication-navbutton-color" content="#aad922" />
    <meta name="msapplication-notification" content=".xml/?type=rss&amp"/>';

Arantor


confuseamuse

Quote from: Arantor on September 03, 2017, 03:10:47 PM
And how exactly did you edit the file?

Used Xcode and uploaded the file to the server. I recently discovered that the changes had been inserted into the body instead of the head for some reason and the PHP was potentially placing it differently on refreshes. I may just have to add it to the already existing section that's in the head currently, even if that means putting it in another file.

Kindred

Ummmm... unless you placed the code in the incorrect place, what you describe just won't happen
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: