website is live since yesterday, I when I upload website on hosting server and I created .htaccess file for ExpiresByType purpose, and it turned out that it was a mistake because I guess that is the reason why changes do not appear on the site. This is my .htaccess file:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!) and cursor images
ExpiresByType image/x-icon "access plus 1 week"
# HTML components (HTCs)
ExpiresByType text/x-component "access plus 1 month"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 year"
# Manifest files
ExpiresByType application/x-web-app-manifest json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Media
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# Web feeds
ExpiresByType application/atom xml "access plus 1 hour"
ExpiresByType application/rss xml "access plus 1 hour"
</IfModule>
Website is host on https://www.gandi.net/ and I found that there is The Varnish cache system which prevents the visibility of my changes I guess.
Here is a PHP script that I called from a browser to clear a particular URL cache - from this link:
<?php
/* purge.php
* Purge a URL on this host
*/
header("Cache-Control: max-age=1"); // don't cache ourself
error_reporting(E_ALL);
ini_set("display_errors", 1);
// Set to true to hide varnish result
define("SILENT", false);
$path = isset($_GET["path"]) ? $_GET["path"] : "";
$purge_url = "http://" . $_SERVER["HTTP_HOST"] . "/$path";
if ( $ch = curl_init($purge_url) ) {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PURGE");
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_NOBODY, SILENT);
curl_exec($ch);
curl_close($ch);
}
?>
Then I noticed that my website is not cached with Varhish because Age is 0. See here http://image.prntscr.com/image/eacd88658f8a43d8a71b21a8109797b3.png
but changes are not displayed. Do you have any idea ?
</div>