Author |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Sat 21 Jan '12 13:56 Post subject: No mod_mem_cache in 2.4, what gives? |
|
|
Moderator edit:
Since this was getting off topic from Steffen's 2.4.0 release announcement, I split this off into it's own thread
I don't know why they remove mod_mem_cache
if you hand no hardware raid you are fucked
if you had no SSD you are fucked
etc etc |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 21 Jan '12 15:55 Post subject: |
|
|
I don't know how it works or if it the same, but there is mod_socache_memcache. The documentation is not complete at all in this case. |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Sat 21 Jan '12 20:12 Post subject: |
|
|
I try something like this on apache 2.2 but whose caching 2x gzip css and js files
Now i had:
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .*?\.js$ $1.gjs [L]
AddType "text/javascript;charset=UTF-8" .gjs
<FilesMatch "\.gjs$">
Header set Content-Encoding gzip
SetEnv no-gzip 1
</FilesMatch>
gzip.exe -c -9 file.js > file.gjs
Maybe i try again |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sun 22 Jan '12 21:46 Post subject: |
|
|
Gzip? That is the same mod_deflate does. Do you use a subdomain for delivering js and css files? |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Wed 25 Jan '12 16:06 Post subject: |
|
|
Gzip? That is the same mod_deflate does
yep
But i make test
When user-agent is other that saved in cache then apache make again gzip. Just check mod_disc_cache directory by view in notepad cached file
.
You can check this in proces monitor.
When i use mod_mem_cache in process monitor is no request to disc
Do you use a subdomain for delivering js and css files?
no
eq
domain.com ->
reuqest to cdn.domain.com need another dns request |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 27 Jan '12 11:40 Post subject: |
|
|
Kanashii wrote: |
You can check this in proces monitor.
When i use mod_mem_cache in process monitor is no request to disc
|
Yeah, that is not so good for the performance.
Kanashii wrote: |
reuqest to cdn.domain.com need another dns request
|
That is true, but the client does this only 1 time. After that the DNS request in the in DNS cache of the client (ipconfig /displaydns). You can take only one subdomain like static.example.com
I tried that. Makes my site much faster.
Did you already try mod never expire?
---- edit ----
I think Steffen didn't compiled mod never expire yet for 2.4 |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Fri 27 Jan '12 20:41 Post subject: |
|
|
I had a look at mod_never_expire to see if it would be 2.4 compatible, nothing jumps out that I know doesn't, however it's not really "never_expire," but more mod_expire_on_21-12-2014_13:33:33_GMT.
Code: | /* XXXXXXX: change this when I turn 30. */
apr_table_set(r->headers_out, "Expires", "Sun, 21 Dec 2014 13:33:33 GMT");
|
While looking up the max-age header I saw something interesting, mod_expires;
ExpiresActive On
ExpiresByType text/css "access plus 10 years"
ExpiresByType text/javascript "access plus 10 years"
____________________________________________________________________________________________________
Edit: By the way, how about the word "screwed" or something else instead of the F-bomb?. I do however understand your frustration.
It was planed to have something like mod_cache_socache to replace mom_mem_cache, it just never seemed to materialize.
One could also try building the 2.2 module for 2.4, unfortunately the cache system in 2.4 is different from 2.2. But, I do not see how it could not still be done, you just may not be able to mix & match use of the two different mod_cache's.
I've done just this, I'm just not sure how to know if it is working or not. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 28 Jan '12 1:58 Post subject: |
|
|
mod_socache_* are just utility modules for other modules to hook into and use. A good example is one of them must be used for mod_ssl. Another similar modules is the slotmem ones, they have no use on their own but have hooks for other modules to utilize (proxy_balancer, heartmonitor, watchdog I can think of).
The key is to make a mem_cache module that utilizes any of the socache modules, since they are all mem based anyway as far as I know. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 28 Jan '12 9:41 Post subject: |
|
|
The mod_disk_cache and mod_cache part is working, so I will assume (uh oh!) mem_cache is as well. |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 01 Feb '12 12:53 Post subject: |
|
|
I tried that pre deflating. My rewrite rules is a bit different than yours.
Code: |
<IfModule mod_rewrite.c>
AddEncoding gzip .gz
<FilesMatch "\.js\.gz$">
AddType "text/javascript" .gz
</FilesMatch>
<FilesMatch "\.css\.gz$">
AddType "text/css" .gz
</FilesMatch>
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME} \.(js|css)$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]
</IfModule>
|
I have to run that on my windows box and the linux box to test that. Did you run tests on your own yet? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 01 Feb '12 15:49 Post subject: |
|
|
Just found put that there is a new zlib version 1.2.6 which shall be faster as the author says ... |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Wed 01 Feb '12 19:19 Post subject: |
|
|
But should be there 2 files
file.js
file.gz
so
gzip.exe -c -9 file.js > file.gz
I had using this on my server but now is off-line and support try it repair for 4 hour |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 02 Feb '12 0:05 Post subject: |
|
|
Kanashii wrote: | But should be there 2 files |
?? I don't get that!?
Sure there are two files. RewriteCond %{HTTP:Accept-encoding} gzip checks if the client can do gzip encoding.
Are we lost in translation? |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Thu 02 Feb '12 15:35 Post subject: |
|
|
Example:
/_e/s.css
/_e/s.gcss
Then run command:
gzip.exe -c -9 s.css > s.gcss
http.conf
Quote: |
<Directory "%PATH%/_e/">
RewriteEngine on
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule f.js$ f.gjs [L]
RewriteRule s.css$ s.gcss [L]
AddType "text/css;charset=UTF-8" .gcss
AddType "text/javascript;charset=UTF-8" .gjs
<FilesMatch "\.gjs$">
Header set Content-Encoding gzip
SetEnv no-gzip 1
</FilesMatch>
<FilesMatch "\.gcss$">
Header set Content-Encoding gzip
SetEnv no-gzip 1
</FilesMatch>
</Directory>
|
Sorry my server whose down for 8 hours and i had lot of work |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 22 Feb '12 8:12 Post subject: |
|
|
Kanashii,
Care to give a very pre-release test build of mod_cache_socache a try, this is the module that will replace mod_mem_cache, hopefully come 2.4.2. The source was posted on the dev list this afternoon.
There are modules for both x86 & x64 in the archive along with the manual page. If you care to give it a try, or anyone cares to give it a try;
NOTE: Link removed. This module is part of Apache 2.4.x since 2.4.4
Last edited by glsmith on Thu 10 Dec '15 19:43; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 15 Mar '12 21:45 Post subject: |
|
|
Does anyone know if Graham commited his patch he announced in his mail to trunk or 2.4 branch?
Quote: |
[Patch] mod_cache_socache (to replace mod_mem_cache)
|
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 15 Mar '12 22:05 Post subject: |
|
|
This are the latest changes dealing with mod_cache :
Revision: 1299718
Author: jim
Date: maandag 12 maart 2012 16:45:03
Message:
Move away from DEFAULT_REL_RUNTIMEDIR and use ap_runtime_dir_relative()API
----
Modified : /httpd/httpd/trunk/modules/cache/mod_socache_dbm.c
Modified : /httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c
Modified : /httpd/httpd/trunk/modules/generators/mod_cgid.c
Modified : /httpd/httpd/trunk/server/mpm/prefork/prefork.c
Modified : /httpd/httpd/trunk/server/util_mutex.c
Revision: 1209766
Author: sf
Date: zaterdag 3 december 2011 0:02:04
Message:
Add lots of unique tags to error log messages
...
...
And:
Revision: 1299718
Author: jim
Date: maandag 12 maart 2012 16:45:03
Message:
Move away from DEFAULT_REL_RUNTIMEDIR and use ap_runtime_dir_relative()
API
----
Modified : /httpd/httpd/trunk/modules/cache/mod_socache_dbm.c
Modified : /httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c
Modified : /httpd/httpd/trunk/modules/generators/mod_cgid.c
Modified : /httpd/httpd/trunk/server/mpm/prefork/prefork.c
Modified : /httpd/httpd/trunk/server/util_mutex.c |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Fri 16 Mar '12 1:49 Post subject: |
|
|
No, my last look there was no mod_cache_socache.c file present in trunk and it must land there first. If you want, his email is dated Feb. 21, 2012. Reply with a +1 to it. |
|
Back to top |
|