Wp-Json Cache

Erreur du serveur dans l’application ‘/’.

Erreur d’exécution

Description : Une erreur d’application s’est produite sur le serveur. Les paramètres d’erreur personnalisés actuels pour cette application empêchent l’affichage à distance des détails de l’erreur de l’application (pour des raisons de sécurité). Cependant, ils peuvent être affichés par les navigateurs qui s’exécutent sur l’ordinateur serveur local.

Détails: Pour permettre l’affichage des détails de ce message d’erreur spécifique sur les ordinateurs distants, créez une balise dans un fichier de configuration "web.config" situé dans le répertoire racine de l’application Web en cours. Attribuez ensuite la valeur "off" à l’attribut "mode" de cette balise .

Remarques: La page d’erreurs actuellement affichée peut être remplacée par une page d’erreurs personnalisée. Pour ce faire, modifiez l’attribut "defaultRedirect" de la balise de configuration de l’application, de sorte qu’il pointe vers une URL de la page d’erreurs personnalisée.

Wp-json cache

I am trying to query a quote API for a freeCodeCamp project I’m updating to React.js. I am now trying to use Fetch or Axios to query the API but it’s caching the response in the browser. I know in $ajax there is a < cache: false >that would force the browser to do a new request.

Is there some way I will be able to do the same with Fetch or Axios ?

The cache-control setting seems to be already set to max-age: 0 by Axios .

This is my code I have that is querying the API.

Okay so I found a solution. I had to set a timestamp on the API url to get it to make a new call. There doesn’t seem to be a way to force axios or fetch to disable cache.

This is how my code now looks

I think you just need to make the url different each time you make the axios call. Timestamp is just one way to do so. Also consider disabling or filtering service workers caching method if you are developing a PWA.

Linux and Unix tutorials for new and seasoned sysadmin

Linux and Unix tutorials for new and seasoned sysadmin

How to use curl command with proxy username/password on Linux/ Unix

M y sysadmin provided me the following proxy details:
IP: 202.54.1.1
Port: 3128
Username: foo
Password: bar

The settings worked perfectly with Google Chrome and Firefox browser. How do I use it with the curl command? How do I tell the curl command to use my proxy settings from Google Chrome browser?

Many Linux and Unix command line tools such as curl command, wget command, lynx command, and others; use the environment variable called http_proxy, https_proxy, ftp_proxy to find the proxy details. It allows you to connect text based session and applications via the proxy server with or without a userame/password. This page shows how to perform HTTP/HTTPS requests with cURL cli using PROXY server.

Adblock detected &#128561;

Unix and Linux curl command with proxy syntax

## Set the proxy address of your uni/company/vpn network ## export http_proxy=http://your-ip-address:port/ ## http_proxy with username and password export http_proxy=http://user:[email protected]:port/ ## HTTPS version ## export https_proxy=https://your-ip-address:port/ export https_proxy=https://user:[email protected]:port/

Another option is to pass the -x option to the curl command. To use the specified proxy:

curl -x url –proxy url –proxy http://user:[email protected]:Port url -x http://user:[email protected]:Port url

Linux use curl command with proxy

First set the http_proxy:

## proxy server, 202.54.1.1, port: 3128, user: foo, password: bar ## export http_proxy=http://foo:[email protected]:3128/ export https_proxy=$http_proxy ## Use the curl command ## curl -I https://www.cyberciti.biz curl -v -I https://www.cyberciti.biz

* Rebuilt URL to: www.cyberciti.biz/ * Trying 202.54.1.1. * Connected to 1202.54.1.1 (202.54.1.1) port 3128 (#0) * Proxy auth using Basic with user ‘foo’ > HEAD HTTP://www.cyberciti.biz/ HTTP/1.1 > Host: www.cyberciti.biz > Proxy-Authorization: Basic x9VuUml2xm0vdg93MtIz > User-Agent: curl/7.43.0 > Accept: */* > Proxy-Connection: Keep-Alive > ; rel="https://api.w.org/" Link: ; rel="https://api.w.org/" $ export http_proxy="vivek:[email protected]:3128/"
$ curl -v -O http://dl.cyberciti.biz/pdfdownloads/b8bf71be9da19d3feeee27a0a6960cb3/569b7f08/cms/631.pdf
OR use the -x option:
curl -x ‘http://vivek:[email protected]:3128’ -v -O https://dl.cyberciti.biz/pdfdownloads/b8bf71be9da19d3feeee27a0a6960cb3/569b7f08/cms/631.pdf
Sample outputs:
Fig.01: curl in action (click to enlarge)

How to use the specified proxy server with curl on Unix

$ curl -x http://prox_server_vpn:3128/ -I https://www.cyberciti.biz/faq/howto-nginx-customizing-404-403-error-page/

How to use socks protocol?

The syntax is same:

curl -x socks5://[user:[email protected]]proxyhost[:port]/ url curl –socks5 192.168.1.254:3099 https://www.cyberciti.biz/

How do I configure and setup curl to permanently use a proxy connection?

/.curlrc file using a text editor such as vim:
$ vi

/.curlrc
Append the following:

proxy = server1.cyberciti.biz:3128 proxy-user = "foo:bar"

Save and close the file. Another option is create a bash shell alias in your

## alias for curl command ## set proxy-server and port, the syntax is ## alias curl="curl -x :" alias curl="curl -x server1.cyberciti.biz:3128"

Remember, the proxy string can be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies. If the port number is not specified in the proxy string, it is assumed to be 1080. The -x option overrides existing environment variables that set the proxy to use. If there’s an environment variable setting a proxy, you can set proxy to “” to override it. See curl command man page here for more info.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Your support makes a big difference:

I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft takes a lot of my time and hard work to produce. If everyone who reads nixCraft, who likes it, helps fund it, my future would be more secure. You can donate as little as $1 to support nixCraft:

3 comment

I want to learn linux + networking for example iptables etc.
What is the best place to start?

I need a help to curl comand to download a large files from google drive, nothing works for me, sorry about my poor english.

thx for the post. this is exactly what i needed.

Wp-json cache

HTTP/1.1 301 Moved Permanently
Date: Wed, 03 Oct 2018 16:15:16 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Wed, 03 Oct 2018 17:15:16 GMT
Location: https://dasibayo.com/
Server: cloudflare
CF-RAY: 4640b4dd96189402-SJC

HTTP/1.1 200 OK
Date: Wed, 03 Oct 2018 16:15:16 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d26b42c9e0559f7d2ad593db06f9b49001538583316; expires=Thu, 03-Oct-19 16:15:16 GMT; path=/; domain=.dasibayo.com; HttpOnly; Secure
X-Powered-By: PHP/7.0.30
Link: ; rel="https://api.w.org/"
Link: ; rel=shortlink
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 4640b4ddcee795ef-SJC

Domain name: dasibayo.com
Registry Domain ID: 2251661931_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.namecheap.com
Registrar URL: http://www.namecheap.com
Updated Date: 2018-04-13T13:00:30.00Z
Creation Date: 2018-04-13T08:53:40.00Z
Registrar Registration Expiration Date: 2019-04-13T08:53:40.00Z
Registrar: NAMECHEAP INC
Registrar IANA ID: 1068
Registrar Abuse Contact Email: abuse
Registrar Abuse Contact Phone: +1.6613102107
Reseller: NAMECHEAP INC
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Domain Status: addPeriod https://icann.org/epp#addPeriod
Registry Registrant ID:
Registrant Name: WhoisGuard Protected
Registrant Organization: WhoisGuard, Inc.
Registrant Street: P.O. Box 0823-03411
Registrant City: Panama
Registrant State/Province: Panama
Registrant Postal Code:
Registrant Country: PA
Registrant Phone: +507.8365503
Registrant Phone Ext:
Registrant Fax: +51.17057182
Registrant Fax Ext:
Registrant Email: 45f4a13dc65446a0b2ea4fe1e218cfa4.protect
Registry Admin ID:
Admin Name: WhoisGuard Protected
Admin Organization: WhoisGuard, Inc.
Admin Street: P.O. Box 0823-03411
Admin City: Panama
Admin State/Province: Panama
Admin Postal Code:
Admin Country: PA
Admin Phone: +507.8365503
Admin Phone Ext:
Admin Fax: +51.17057182
Admin Fax Ext:
Admin Email: 45f4a13dc65446a0b2ea4fe1e218cfa4.protect
Registry Tech ID:
Tech Name: WhoisGuard Protected
Tech Organization: WhoisGuard, Inc.
Tech Street: P.O. Box 0823-03411
Tech City: Panama
Tech State/Province: Panama
Tech Postal Code:
Tech Country: PA
Tech Phone: +507.8365503
Tech Phone Ext:
Tech Fax: +51.17057182
Tech Fax Ext:
Tech Email: 45f4a13dc65446a0b2ea4fe1e218cfa4.protect
Name Server: igor.ns.cloudflare.com
Name Server: ashley.ns.cloudflare.com
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2018-12-27T10:11:38.32Z <<<

Wp-json cache

In a new project we are using wp-super-cache (the client’s preferred plugin) to create the static html files for custom content types. But we are trying to figure out if everything is being cached properly.

This is a 2 part question.

1) The theme we have created utilizes page templates to output json that is ingested via ajax calls. ie. if you hit the page: theurl.com/sample – you will get pure json. While there is a non-javascript version of every page and post, Ajax drives the front end of this theme. We have removed the header and footer in these files so that it is pure json, and we are trying to figure out how to determine if the json is being cached. In theory the data would be cached because it is technically a page served up by wordpress. But, how can we figure out if it is being cached?

2) We are using the json api plugin to serve up certain post data as well. http://wordpress.org/extend/plugins/json-api/ For this example, let’s say we are utilizing the plugin’s default method of output and hitting this page: my url.com/category/news?json=1 – Does anyone know how we can verify if this output is being cached? If it isn’t being cached, what method would make this happen?

There doesn’t seem to be much information about this online, so in the spirit of creating compelling and optimized wordpress sites, help a brother out

LEAVE A REPLY

Your email address will not be published. Required fields are marked *