How disable XAMPP or PHP caching? - xampp

After I reinstalled XAMPP and copied the projects folder into htdocs and ran the script to create the database I have a rare case of cache. This is something that I have done on other occasions without problems.
Regardless of the changes you make to the code, a previous version is always displayed without the changes.
I clean the browser cache... no changes. I ruled out that the problem was in the browser, because I used two other browsers where I had never opened the page and the version showed is the same without the changes.
In PHP I have the headers to avoid the cache:
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); // HTTP/1.1
header('Pragma: no-cache');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
In httpd.conf I commented the line of:
LoadModule cache_module modules/mod_cache.so
Without success... I installed an older version of XAMPP and the problem remains.
Some suggestion, please??
Regards

Related

SuiteCRM 8 htaccess error after install: public/legacy/.htaccess: RewriteBase: argument is not a valid URL

I am trying to install SuiteCRM-8.2.1 on a server for a client and everything has run fine but there seems to be a .htaccess file problem
This is the error in the dashboard,profile, admin
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at you#example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
[core:alert] [pid 67661] [client ::1:62740] /Applications/MAMP/htdocs/SuiteCRM/public/legacy/.htaccess: RewriteBase: argument is not a valid URL, referer: http://localhost:8888/SuiteCRM/public/
I am trying to install SuiteCRM on mamp. During the installation above errors encountered.
Pls suggest to me if anyone has a solution
Try updating RewriteBase to /public/legacy
Please also make sure that the site_url on /<your-crm>/public/legacy/config.php is correct. It should be pointing to your legacy path, something like: https://<your-host>/public/legacy
Note: Please note that if your vhost is not directly pointing to /<your-crm>/public and you have SuiteCRM installed on a sub-folder like https://<your-host>/suite-8/public you will need to add something like /suite-8/public/legacy to RewriteBase. And something like https://<your-host>/suite-8/public/legacy to site_url on config.php.

Cannot see changes in Magento 2 js and css

I am new to magento 2 and I am creating extension for it.
But I am unable to see any js and css changes.
When i check on my source code my js file custom.js and css file custom.css is loaded properly but i am unable to see any of my changes.
I tried to clear cache and didn't get any result.
I cleared cache from backed and manually as well and disabled all
cache too.
step 1.
rm -rf pub/static/frontend/*
step 2.
rm -rf var/cache/*
step 3.
php bin/magento s:s:d -f
step 4.
php bin/magento indexer:reindex
The above step worked for me. I hope it will work for you also.
step 1. delete all folders under pub/static/frontend
step 2. delete cache folder under var/cache
Now open your command prompt and go to your root installation of magento 2
and fire the following commands
step 3. php bin/magento setup:static-content:deploy
step 4. php bin/magento indexer:reindex
The above step worked for me. I hope it will work for you also.
Let me know if you still facing any problem.
To work efficient it is possible to use the following command to do all tasks together:
rm -rf var/view_preprocessed; rm -rf pub/static/frontend/*; rm -rf var/cache/*; php bin/magento setup:static-content:deploy -f de_DE;
Even if Magento is in Dev mode, Nginx may set caching headers on Javascript and CSS files:
$ bin/magento deploy:mode:show
Current application mode: developer. (Note: Environment variables may override this value.)
See that Note? And sure enough:
$ curl -v 'https://foo.local/static/version51/adminhtml/Magento/backend/en_US/Dc_Foo/js/foo.js'
< HTTP/1.1 200 OK
< Server: nginx/1.21.6
< Date: Tue, 12 Jul 2022 12:00:07 GMT
< Content-Type: application/javascript; charset=utf-8
< Content-Length: 1082
< Last-Modified: Tue, 12 Jul 2022 05:57:18 GMT
< Connection: keep-alive
< ETag: "62cd0d3e-43a"
< Expires: Wed, 12 Jul 2023 12:00:07 GMT
< Cache-Control: max-age=31536000
< Cache-Control: public
< X-Frame-Options: SAMEORIGIN
< Accept-Ranges: bytes
Note the Expires header, set for one year in the future (answer written July 2022).
You can configure Nginx or Apache or any other server to not serve these headers, but my preferred method is to configure my browser to ignore caching when development tools are in use. In Chrome that can be accomplished by opening DevTools (F12), then clicking on the gear icon (⚙), then checking Preferences -> Network -> Disable cache while DevTools is open.
It may be because a core CSS rule has a priority over your css rule for the same DOM element. You should check it with a browser developer tools.
Require JS will cache the changes to your javascript files (even in developer mode). To disable caching, add the below to MyNamespace/MyModule/view/frontend/requirejs-config.js
var config = {
urlArgs: "bust=" + (new Date()).getTime()
};

406 Not Acceptable on MacOSX Maverick

I am really new for Mac OSX, I had develop the web based application while communicate with another server.
Tried before on Linux, the scripts works well, but when I tried to implemented on Mac OSX server I got the error:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>406 Not Acceptable</title>
</head><body>
<h1>Not Acceptable</h1>
Tried using .htaccess
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
and this:
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
I tried to testing this on Linux environtment, and works.
Anyone know how to fix this on Mac?
Thanks

HTTP cache headers with .htaccess

I am trying to configure my .htaccess file to set the cache time. Tryied every possible configuration but nothing works!
This is what is written in my HTML:
<meta http-equiv="Cache-Control" content="max-age=2592000, public" />
<!--
<meta http-equiv="expires" content="mon, 24 sep 2012 14:30:00 GMT">
-->
and this is what written in my .htaccess file:
ExpiresActive On
ExpiresDefault A3600
However, when I refresh inclusind cache clear (ctrl+F5) in firefox, my firebug NET panel says that the cache expires at the same second I have accessed the file ( and not in the future, as I want it to be).
What am I doing wrong??
Thanks
I advise you to use headers mod. You can activate it (if disabled) with this command :
a2enmod headers
Here is a simple code example that works:
<IfModule mod_headers.c>
# WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# WEEK
<FilesMatch "\.(js|css|swf)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
</IfModule>
max-age is cached time in seconds.

File Not download completely

I have written code to download audio files. When I try to download a file more than 50MB through PHP, it does not download completely. It downloads a maximum of 45MB. Every time I try to download, the download size varies from 36MB to 45MB.
I have changed the configuration in php.ini as follows:
memory_limit 512M
post_max_size 512M
upload_max_filesize 512M
In phpinfo(), its show the above value after I change the configuration. Still I have the same problem.
I use the following code to download:
<?php
$file = "file to download";
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
?>
Help me to resolve this
Thanks
Anyone have idea on this? I use Download Manager to download a file . When it reach 65% it shows Error message as "Data Transfer has been interrupted and the server doesnot support resume. Its only possible to download from the beginning"..
How to resolve this?

Resources