Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I know it sounds crazy but I'm sitting here with various phone on different networks and all the phones on the sprint network are failing to work correctly.
It looks as if the LESS style sheet is not being applied. Has any one ever ran into any thing like this?
Also just visited the LESS website figuring all there styles would be created with LESS and its doing the same thing. Failing to load/apply the LESS.
The specific phones I have tried on the sprint network are two iphones and one android optimus V.
I would strongly suggest pre-processing your LESS file into CSS and serving that on your site.
It is considerably more efficient as even a medium sized less file can take hundreds of milliseconds to process during page load. It is also one less javascript file to download in production. Finally, it is a lot less processor overhead on mobile devices that need to not only parse the javascript, but then parse the less file as well. Some mobile devices don't have caching or local storage so there is a potential for them to be re-processing the less file every time the page loads.
Either use the lessc compiler (requires Node.js) or SimpLESS to pre-compile your css files.
You could try to see if it's blocking the download of the less javascript or the stylesheet itself by loading their URLs directly.
For lesscss.org that would be http://lesscss.org/less/main.less and http://lesscss.org/js/less.js
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
tl;dr
I've currently got a PostGresQL database with about 10gb of data. This data is "archived" data- so it won't ever be changing, but I do need the data to be queryable/searchable/available for reading in the cheapest method possible for my Rails app.
Details:
I'm running a Digital Ocean server, but this is a no-profit project, so keeping costs low is essential. I'm currently using a low-end droplet 4 GB Memory / 40 GB Disk / SFO2 - Ubuntu 16.04.1 x64
Querying this data/loading the pages it's used on can take a significant amount of time occasionally. Some pages timeout because they take over a minute to load. (Given, those are very large pages, but still)
I've been looking at moving the database over to Amazon RedShift, but the base prices seem large- as they're aimed at MUCH larger projects than mine.
Is my best bet to try to put more and more into making the queries small and only rendering small bits at a time? Even basic pages have a long query time because the server is slowed down so much. Or is there a method similar to RedShift that will allow me to quickly query the data while also storing it externally for a reasonable price?
You can try Amazon S3 and Amazon Athena. S3 is a super simple storage where you can dump your data in text files and Athena is a service that provides SQL-like interface to data stored on S3. S3 is super cheap and Athena has per runtime cost. Since you said your data isn't going to change and is going to be queried rarely it's a good solution. Check this out: 9 Things to Consider When Choosing Amazon Athena
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a quick question about "mobile". I must add the mobile version to my website and I'm exploring all the solutions. Here are my choices:
1) Add media queries to css and trasform my fixed layout in a responsive layout.
Good: one layout only, code for Google bot is the same
Not good: code is heavier, on mobile I load all the js and CSS, impossibile to go to the desktop version
2) Rails 4.1 Variants
Good: i can create a lightweight mobile website, I can have desktop version, I can optimize the mobile experience, using the layout I can also create mobile apps with Cordova
Not Good: the HTML for the same page is different for desktop and mobile. I'm worried about SEO
Any idea?
There is no single best way. The answer depends on your specific needs and case. This is mostly an opinion-based question.
Both solutions are correct. However, the main difference is that the case (1) is more limited compared to case (2). The CSS-based layout makes sense when you just want to make sure the main version works well on mobile devices. It's not a real optimization, because the device will have to load the entire page in any case.
The second option (2) is a real optimization. By providing device-optimized templates, you can skip the pieces that the mobile device doesn't need (such as big images, unnecessary item listing, etc) effectively reducing the weight of the page. You can also inject mobile-specific features.
The SEO issue is a non-issue. You can instruct the search engines to ignore the SEO content using the appropriate meta tags or you can also use the canonical tag if you should decide to provide the content under a different path or domain (for instance if you add a specific extension for the mobile-optimized pages).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a page with activities of users and their friends , like social network does with posts , likes, comments, and reshares ... , which result with a lot of queries to show this page, sometimes 15 queries , and sometimes more...
Is this a bad thing ? because i'm trying to optimize a lot of things, but the number of queries still high... need your opinions
Slow responses to requests are bad, and lots of queries make for slow responses. But you can have your cake and eat it too with prudent use of caching. Here's a guide to caching in Rails, although you can also cache before the request gets to Rails, e.g. with varnish.
It's generally a good idea to keep the number of database requests to a minimum, they tend to be slow. The database also tends to be the most difficult thing to scale so keeping the load down helps. You can reduce database calls by either rewriting your queries or (more likely) caching in your application or using HTTP caching.
An important thing to do before any of this though, is to define what level of performance you require. Depending on your load it could be that 15 queries is perfectly acceptable. It could also be possible that greater performance gains could be achieved by fixing something else in the code base.
Try to define your requirements, measure to find bottlenecks, then fix.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm just curious... why do some large sites (high traffic, a lot of data) use .html extension on their pages even though it's is clear that it's interpreted by php on the server side?
For example metrolyrics.com/top100.html
It's pretty clear that it uses php on the back-end, but still got .html suffix.
Is it better for SEO? Or am I wrong about the back-end and these pages are really static HTMLs as their extension says?
Every opinion is welcomed. Thanks! :)
Metrolyrics might not necessarily be using PHP for its back-end. It could be using other server side languages such as Ruby or Python.
I'd say one of the main reasons for not having PHP in a websites url is for protection. It is more difficult for people to hack a website if they don't know what language is being used on the back-end.
Secondly, websites tend to look more professional if they don't have an extension. And it raises less questions for end users. It's true that people are more used to seeing .html at the end of a URL, users may get more confused if they see .php instead.
It was a well known convention back in the day where static HTML pages were highly regarded for seo. Basically what they done was to keep thousands of these generated HTML pages on the server, making the website look like a content monster and thus elevating its Page Rank and the amount of google scans.
It's also a good way to cache pages and decrease server calls.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Are there any good (preferably free) tools out there?
Can they give accurate estimates that reflect production results when the app goes live?
I would personally go with Apache Bench http://httpd.apache.org/docs/2.0/programs/ab.html
It's free, straight forward to use and lightweight.
If you are looking for a something a little more robust then I think Apache JMeter might be worth looking at. http://jmeter.apache.org/. Again, it's free, a bit of a learning curve and has a GUI so a little heavier.
You might also want to take a look at this Q/A Performing a Stress Test on Web Application?
WebLoad is open source:
http://www.webload.org/
There's a good summary of tools here.
This is definitely not a free solution, but webmetrics will get the job done. (As well as any website monitoring company in general). They give thorough reports on your web site's performance, and when you schedule load tests you can specify how much load you want to simulate (e.g. simulate 2000 users using my site at once).
I don't think it will break it down and tell you your CPU usage and such, as they stress your website from their servers.
Rails comes with performance testing built in: http://guides.rubyonrails.org/performance_testing.html
You can try Trample, it is load simulation tool here
If you want to visualize performance instead of just look at the numbers you might try Engulf. It's Open Source Software, distributed, and high-performance. http://engulf-project.org/#usage Disclaimer: It's a project I work on.