login community faq
3
1

I have configured a Django app in the server. I’m trying to configure this apache module, but I couldn’t yet.

The page is re-written by mod_pagespeed, but the static media isn’t working. I’m getting 404 for all files.

I don’t know what to do.

This is the name for one file: /static/js/jm.09b1de650ada3b7af523c64d11fa6fbe.jquery,omin,l.js

The original file is: /static/js/jquery.min.js

What can I do?

Thanks

asked Nov 12 '10 at 14:44

humitos's gravatar image

humitos
4613

How are you serving your static media?

(Nov 12 '10 at 15:04) seanf ♦♦ seanf's gravatar image

I am having a similar problem. I think the reason is that your media files at /static/* are being served by Webfaction's main Apache static/php/cgi instance. (this is the typical Webfaction Django setup)

You should be able to fix the problem by:

  1. In your [django]/apache2/conf/httpd.conf file add the following after the ModPagespeed statements
  2. ModPagespeedDisableFilters rewrite_images,extend_cache
  3. reset apache

You can then add the following to your .htaccess file in your static media directory which serves you Static files for django if you want to get some benefits out of mod_pagespeed over your static files (I'm not sure if this does anything for the static files though). SetOutputFilter MOD_PAGESPEED_OUTPUT_FILTER

Hope that helps, It might not be the correct solution but it worked for me!

G

answered Nov 12 '10 at 20:35

Goran's gravatar image

Goran
13

1

You may need to disable caching, compression and combination of js and css files too.

(Nov 12 '10 at 21:27) Goran Goran's gravatar image

Just been recommended to turn mod_pagespeed off due to a bug: http://code.google.com/p/modpagespeed/issues/detail?id=10

(Nov 12 '10 at 22:07) Goran Goran's gravatar image

I have to disable these filters: ModPagespeedDisableFilters rewrite_images,extend_cache,combine_css

I want to keep enabled those filters, but I don't know how to do it yet :(

(Nov 14 '10 at 14:19) humitos humitos's gravatar image

Can't the main Apache serves the images, css and js files re-written by mod_pagespeed?

(Nov 14 '10 at 14:29) humitos humitos's gravatar image

I configured mod_pagespeed following this guide http://blog.webfaction.com/2010/11/speed-up-your-pages-with-mod_pagespeed/

(Nov 14 '10 at 14:32) humitos humitos's gravatar image

mod_pagespeed is still a fairly new module. While Google continues to work on the module, and work on removing bugs, we recommend serving static media as shown here:

http://docs.webfaction.com/software/django/getting-started.html#serving-static-media

(Nov 14 '10 at 15:17) aaronh ♦♦ aaronh's gravatar image
showing 5 of 6 show all

I have the same problem, the css and js are compressed (i can find it in mod_pagespeed/cache/) but the URI of the compressed files is wrong, it point to the original site media dir.

EDIT: my static files are served by NGINX

answered Nov 15 '10 at 04:37

Mauro%20Giorgi's gravatar image

Mauro Giorgi
11

edited Nov 15 '10 at 04:40

One possible solution is to sym-link the files in your cache directory (or even set your page_speed cache directory) to your media directory which is served by NGINX.

The only problem is that this will not work for files in any subfolders in the media directory. E.g. Will work for: /media/*.* but not for /media/css/*.*

(If you are game enough, you could try 'hack' the filters in mod_pagespeed source to rewrite the compressed image and url source paths to another path (e.g. all to go to '/media/cached/' and compile it into a .so module yourself.) ** come to think of it, I wouldn't recommend doing this unless you really know what you are doing!

answered Nov 15 '10 at 04:51

Goran's gravatar image

Goran
13

edited Nov 15 '10 at 04:55

Any news about this problem?

(Dec 24 '10 at 04:37) Mauro Giorgi Mauro%20Giorgi's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×643
×149
×9
×6

Asked: Nov 12 '10 at 14:44

Seen: 2,169 times

Last updated: Dec 24 '10 at 04:37

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited