User Tools

Site Tools


varnish:disable-cache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
varnish:disable-cache [2016/06/27 07:22] – [Cara 2. Menyisipkan di File PHP] kbadminvarnish:disable-cache [2018/02/21 04:34] (current) – [Buat Purge.php] kbadmin
Line 1: Line 1:
 ====== Tutorial Cara Disable Cache Varnish di Sisi Client ====== ====== Tutorial Cara Disable Cache Varnish di Sisi Client ======
-Apabila server hosting anda menggunakan varnish cache yang secara otomatis melakukan cache pada data website anda maka berikut ini adalah cara mendisable cache varnish di website anda.+Apabila server hosting anda menggunakan varnish cache dan Opcache yang secara otomatis melakukan cache pada data website anda maka berikut ini adalah cara mendisable cache varnish di website anda.
  
 ===== Cara 1. Dengan .htaccess ===== ===== Cara 1. Dengan .htaccess =====
Line 6: Line 6:
 <code> <code>
 Header set Cache-Control "max-age=0, private, no-cache, no-store, must-revalidate" Header set Cache-Control "max-age=0, private, no-cache, no-store, must-revalidate"
 +php_flag opcache.enable Off
 </code> </code>
  
Line 23: Line 24:
 <code> <code>
 <?php <?php
-$curl = curl_init("http://your.varnish.cache/url-to-purge");+$curl = curl_init($_SERVER['HTTP_HOST']);
 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE"); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE");
 curl_exec($curl); curl_exec($curl);
 +echo "done";
 ?> ?>
 </code> </code>
  
 selanjutnya akses file tersebut. selanjutnya akses file tersebut.
 +<nspages -h1 -textPages="Related" -exclude:sidebar -exclude>
  
  

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
varnish/disable-cache.1467026564.txt.gz · Last modified: 2016/06/27 07:22 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki