WebFaction
Community site: login 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 12 Nov '10, 14:44

humitos
46113
accept rate: 0%

How are you serving your static media?

(12 Nov '10, 15:04) seanf

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

permanent link

answered 12 Nov '10, 20:35

Goran
13
accept rate: 0%

1

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

(12 Nov '10, 21:27) Goran

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

(12 Nov '10, 22:07) Goran

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 :(

(14 Nov '10, 14:19) humitos

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

(14 Nov '10, 14:29) humitos

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

(14 Nov '10, 14:32) humitos

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

(14 Nov '10, 15:17) aaronh ♦♦
showing 5 of 6 show 1 more comments

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

permanent link

answered 15 Nov '10, 04:37

Mauro Giorgi
11
accept rate: 0%

edited 15 Nov '10, 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!

permanent link

answered 15 Nov '10, 04:51

Goran
13
accept rate: 0%

edited 15 Nov '10, 04:55

Any news about this problem?

(24 Dec '10, 04:37) Mauro Giorgi
Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×225
×15
×10

question asked: 12 Nov '10, 14:44

question was seen: 6,201 times

last updated: 24 Dec '10, 04:37

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM